cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version          = "dev"
	Commit           = ""
	SigningPublicKey = ""
)

Version, Commit, and SigningPublicKey are set with -ldflags in release builds. SigningPublicKey is the base64 ed25519 public key that examines the signatures of CLI releases. A build without it installs no updates. See docs/releasing.md.

Functions

func Execute

func Execute(args []string) (string, error)

func ExitCode

func ExitCode(err error) int

func InvokedAsLegacy

func InvokedAsLegacy(arg0 string) bool

InvokedAsLegacy reports whether the binary ran under its old name.

func MigrateLegacyBinary

func MigrateLegacyBinary()

MigrateLegacyBinary runs when the binary starts as aidocs, which is what a pre-rename auto-update leaves behind. It renames the file to slashdocs and leaves aidocs as a symlink, so the old name keeps printing the rename notice.

func MigrateLegacyInstall

func MigrateLegacyInstall()

MigrateLegacyInstall moves the old config directory and agent skills to their new names. It is best-effort and runs before every command, so it only costs a few stat calls once the move is done.

func NewRoot

func NewRoot(out io.Writer) *cobra.Command

func RenameNotice

func RenameNotice() string

RenameNotice tells an agent or a person who ran the old name what to do. When slashdocs is not on PATH, it also gives the install command.

Types

type APIError

type APIError struct {
	Status  int
	Code    string
	Message string
	Body    string
}

APIError represents a non-2xx response from the API.

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	Base, Token string
	HTTP        *http.Client
	// contains filtered or unexported fields
}

Client is a thin HTTP transport for the slashdocs API.

type Config

type Config struct {
	ActiveContext string              `json:"active_context"`
	Contexts      map[string]*Context `json:"contexts"`
}

type Context

type Context struct {
	Server     string            `json:"server"`
	Credential map[string]any    `json:"credential,omitempty"`
	Pulled     map[string]string `json:"pulled"`
}

Jump to

Keyboard shortcuts

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