Documentation
¶
Overview ¶
Package cli implements the nota command line. Every command works on one vault (found by vault.Discover), keeps the index up to date before it reads from it, and prints JSON instead of text with --json.
Index ¶
Constants ¶
const ( ExitOK = 0 ExitError = 1 // anything else: IO, broken index, editor failed ExitUsage = 2 // bad flags or arguments ExitNotFound = 3 // no such note, view or vault ExitAmbiguous = 4 // a note reference matched several notes ExitConflict = 5 // the target exists or differs only in case )
Exit codes. Scripts can rely on them.
const ( EnvServerAddr = "NOTA_SERVER_ADDR" EnvServerData = "NOTA_SERVER_DATA" EnvServerMaxFileSize = "NOTA_SERVER_MAX_FILE_SIZE" EnvServerLogFormat = "NOTA_SERVER_LOG_FORMAT" // EnvServerPublicURL is the API's own public URL. EnvServerPublicURL = "NOTA_SERVER_PUBLIC_URL" // EnvServerWebOrigin lists the web app's origins, comma-separated; // the first is where sign-in links point. EnvServerWebOrigin = "NOTA_SERVER_WEB_ORIGIN" // EnvServerRPID is the WebAuthn relying party id (passkeys are off // without it). EnvServerRPID = "NOTA_SERVER_RP_ID" // EnvServerCookieDomain is the session cookie's Domain. EnvServerCookieDomain = "NOTA_SERVER_COOKIE_DOMAIN" // EnvServerCookieInsecure=1 drops the cookie's Secure flag (local http only). EnvServerCookieInsecure = "NOTA_SERVER_COOKIE_INSECURE" // EnvServerSignup is invite (default), open or closed. EnvServerSignup = "NOTA_SERVER_SIGNUP" // EnvServerTrustedProxies lists proxies (IPs, CIDRs or "private") // whose X-Forwarded-For is believed. EnvServerTrustedProxies = "NOTA_SERVER_TRUSTED_PROXIES" // EnvServerPollInterval is the device-code poll interval (default 5s). EnvServerPollInterval = "NOTA_SERVER_POLL_INTERVAL" // EnvServerHooks=on runs each vault's .nota/hooks.toml on the server // (default off). EnvServerHooks = "NOTA_SERVER_HOOKS" )
Server environment variables. Flags win over them.
const DefaultServer = "https://nota.app.banjoanton.com"
DefaultServer is the Nota server `nota login` uses when no URL is given and the vault has no remote.
const EnvNow = "NOTA_NOW"
EnvNow fixes the clock for timestamps written into notes (RFC 3339). It exists for tests and reproducible scripts.
const EnvServerURL = "NOTA_SERVER_URL"
EnvServerURL overrides DefaultServer.
Variables ¶
var Version = "dev"
Version is set at build time with -ldflags "-X github.com/banjo/nota/internal/cli.Version=…".