Documentation
¶
Overview ¶
P88 Sprint 05: `nself ai chat` — quick chat for verification. Acceptance criteria: `nself ai chat "hello"` returns coherent local response <3s.
P88 Sprint 03: `nself ai pool` — 8 subcommands for Gemini pool management.
Package commands: controller + project subcommands for B46 multi-tenant master controller.
CLI surface:
nself controller start | stop | status | init nself project create --slug <slug> --domain <domain> nself project delete --slug <slug> [--force] nself project list nself project status --slug <slug> nself project migrate --slug <slug> nself project shell --slug <slug> nself project rotate-credentials --slug <slug>
Feature flag: NSELF_FLAG_MULTI_TENANT_CONTROLLER must be true. When OFF, all commands print 503 Multi-tenant controller not enabled.
P88 Sprint 05: `nself doctor --ai` first-run wizard. Tickets: T-05-01 (wizard), T-05-02 (headless), T-05-03 (idempotency).
Package commands — gdpr.go ¶
`nself gdpr` implements GDPR data portability (Art. 20) and right-to-erasure (Art. 17) flows for self-hosted nSelf instances.
Subcommands:
nself gdpr export --user <id> Build an export archive for a user nself gdpr delete --user <id> Cascade-delete/anonymize a user's data nself gdpr status --request <id> Show status of a GDPR request nself gdpr list-requests List all GDPR requests
Package commands — security.go ¶
`nself security` provides server-level security operations: audit, setup, and status. These commands inspect the host environment (firewall, fail2ban, SSH config) and the running stack for common hardening gaps. They are intentionally non-destructive by default — `setup` requires `--apply` to make changes, otherwise it prints what would be done.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RootCmd = &cobra.Command{ Use: "nself", Short: "nSelf CLI - Serverless hosting, anywhere", Long: `nSelf CLI empowers you to deploy a fully-featured, production-ready backend to any hosting provider with absolute simplicity. The Golden Path: nself init # Generate your pristine .env configuration nself build # Compose your infrastructure nself start # Boot your stack`, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }, SilenceUsage: true, SilenceErrors: true, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func EnsureOutboxDir ¶ added in v1.0.6
func EnsureOutboxDir() error
EnsureOutboxDir creates the outbox directory if it does not exist. Called during nself setup to ensure the durable queue is ready.
func Execute ¶
func Execute() error
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main().
func RegisterControllerCommands ¶ added in v1.0.12
RegisterControllerCommands attaches controller + project commands to the root command.
Types ¶
type AdminConnection ¶ added in v1.0.6
type AdminConnection struct {
Name string `json:"name"`
Host string `json:"host"`
User string `json:"user"`
Port int `json:"port"`
LocalPort int `json:"local_port"`
RemotePort int `json:"remote_port"`
}
AdminConnection represents a saved remote admin connection.
type AdminProject ¶ added in v1.0.6
type AdminProject struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Host string `json:"host"`
SSHUser string `json:"ssh_user"`
URL string `json:"url"`
}
AdminProject represents a project in the multi-project config.
type ClawConfig ¶ added in v1.0.6
type ClawConfig struct {
APIKey string `yaml:"api_key,omitempty"`
ServerURL string `yaml:"server_url,omitempty"`
}
ClawConfig holds the CLI-to-claw-server configuration.
type FunctionInfo ¶ added in v1.0.11
type FunctionInfo struct {
Name string `json:"name"`
Status string `json:"status"`
URL string `json:"url"`
Dir string `json:"dir"`
}
FunctionInfo describes a deployed function.
type LogSummary ¶
type LogSummary struct {
Service string
TotalLines int
ErrorCount int
WarnCount int
TopErrors []string // up to 5 most frequent error messages (deduped)
LastLine string
}
LogSummary holds per-service log analysis results.
func CollectLogSummary ¶
func CollectLogSummary(ctx context.Context, workdir string, service string, maxLines int) (*LogSummary, error)
CollectLogSummary fetches and analyses recent logs for a single service.
type LogVolume ¶
type LogVolume struct {
Service string
LinesPerMin float64
BytesPerMin float64
ErrorRate float64 // errors / total lines in sample window
}
LogVolume holds per-service log volume sample data.
type LogsOptions ¶
type LogsOptions struct {
Search string
Grep string // regex pattern for --grep
Errors bool
Level string // debug|info|warn|error
Compact bool
Quiet bool
Tail int
Follow bool
Since string // relative (1h, 30m) or absolute RFC3339
Until string // relative or absolute RFC3339
JSON bool // structured JSON output per line
NoColor bool
Plain bool // disable highlighting for piping
Service []string
}
LogsOptions holds parsed flag values for log filtering and formatting.
Source Files
¶
- account.go
- admin.go
- admin_connect.go
- ai.go
- ai_chat.go
- ai_pool.go
- ai_studio.go
- alerts.go
- aliases.go
- api.go
- audit.go
- backup_ops.go
- billing.go
- browser.go
- build.go
- claw.go
- claw_chat.go
- claw_config.go
- claw_export.go
- claw_keys.go
- claw_mcp.go
- claw_memories.go
- claw_migrate.go
- claw_prompt.go
- claw_proxy.go
- claw_status.go
- claw_topics.go
- clean.go
- completion.go
- config.go
- controller.go
- db.go
- db_audit.go
- db_hasura_git.go
- db_pgbouncer.go
- db_pitr.go
- db_rls.go
- db_schema.go
- db_seed_ext.go
- deploy.go
- dev.go
- dlq_replay.go
- dns.go
- doctor.go
- doctor_ai.go
- doctor_homebrew.go
- doctor_sysinfo_linux.go
- doctor_sysinfo_unix.go
- dogfood.go
- dr.go
- encryption.go
- env.go
- exec.go
- federation.go
- flag.go
- functions.go
- gdpr.go
- generate.go
- health.go
- help_topics.go
- infra.go
- init.go
- init_presets.go
- k8s.go
- license.go
- license_grace.go
- license_migrate.go
- license_simulate.go
- license_tail.go
- login.go
- logout.go
- logs.go
- mail.go
- maintenance.go
- mcp.go
- migrate.go
- migrate_from_v099.go
- migrate_generate.go
- migrate_watch.go
- model.go
- monitor.go
- oauth_refresh.go
- ollama.go
- pentest.go
- pitr.go
- plugin.go
- plugin_compat_check.go
- plugin_debug.go
- plugin_dev.go
- plugin_info.go
- plugin_link.go
- plugin_logs.go
- plugin_marketplace.go
- plugin_new.go
- plugin_search.go
- plugin_submit.go
- plugin_test_cmd.go
- promote.go
- queue.go
- region.go
- release.go
- release_check.go
- reset.go
- restart.go
- root.go
- secrets.go
- security.go
- self_heal.go
- service.go
- soak_abort.go
- ssl.go
- ssl_setup.go
- start.go
- status.go
- stop.go
- telemetry.go
- template.go
- tenant.go
- trust.go
- uninstall.go
- update.go
- update_images.go
- upgrade.go
- urls.go
- verify_sbom.go
- version.go
- waf.go
- watchdog.go
- webhooks.go