cli

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package cli wires every subcommand the a-novel binary exposes. The existing `test` / `build` / `run` commands are wrapped from cmd/a-novel/main.go's legacy implementations; new daemon-backed verbs (core, ps, start, kill, logs, env, volume, ...) are implemented here directly against internal/client/rpc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDaemonReexec added in v1.0.1

func IsDaemonReexec(args []string) bool

IsDaemonReexec reports whether args (typically os.Args) invoke the hidden daemon re-exec — `a-novel core __daemon`. main() uses it to skip the version-update check in the detached, long-lived daemon process (which has no user watching and must not phone home on shutdown).

func NewRoot

func NewRoot(legacy LegacyHandlers) *cobra.Command

Types

type ExitError

type ExitError struct{ Code int }

ExitError signals an explicit os.Exit code. Cobra's exec returns the error; main.go inspects it for the precise code.

func (*ExitError) Error

func (e *ExitError) Error() string

type LegacyHandlers

type LegacyHandlers struct {
	Test  func(args []string) int
	Build func(args []string) int
}

LegacyHandlers carries the entrypoints for the standalone capabilities (test, build), which run their own flag parsers rather than Cobra's. cmd/a-novel injects them so that flag-parsing code stays in that package; the daemon-backed verbs under `run` live entirely in this one.

There is no `Run` handler: `run` is the parent namespace for the daemon-backed verbs, so a standalone run capability would collide with it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL