Init Commands
sftpwarden init
Creates a SFTPWarden project and registers it in the local context registry. It can create local Compose projects, remote local-sync projects, remote-only context entries, Kubernetes manifest projects, and Helm projects.
For new projects, init writes sftpwarden.yaml, creates empty provider
storage, writes deployment files when the target is Compose, and selects the new
context as the active context.
sftpwarden init dev --yes
sftpwarden init demo --user-schema 1 --yes
sftpwarden init prod --provider postgresql --dsn '${SFTPWARDEN_POSTGRES_DSN}' --create-table
sftpwarden init prod --remote [email protected]:/opt/sftpwarden --critical
sftpwarden init archive --remote [email protected]:/opt/sftpwarden --remote-only --critical
sftpwarden init prod --deploy kube --namespace sftpwarden --yes
sftpwarden init prod --deploy helm --namespace sftpwarden --yes
Arguments
Argument |
Required |
Value |
What it means |
|---|---|---|---|
|
No |
|
Context/project name to create. If omitted, interactive mode asks for it. The positional value |
Options
Flag |
Value |
Default |
What it does |
|---|---|---|---|
|
|
none |
Context name used by remote init compatibility mode. For normal init, prefer the positional |
|
|
global default, then |
Selects the user provider type stored in |
|
|
current directory |
Local project root to initialize or register. |
|
|
none |
Creates a remote context from |
|
|
none |
Compatibility alias for a remote URL. Mutually exclusive with |
|
|
none |
Database URL for SQL and MongoDB providers. Required with |
|
|
provider default |
Custom SQL read query for SQL providers. Use only when the table shape is managed outside SFTPWarden. |
|
|
|
SQL users table name for MySQL, MariaDB, PostgreSQL, and SQLite. |
|
|
|
MongoDB collection name. |
|
|
|
Provider user schema to initialize. v1 is the simple |
|
|
|
Deployment target stored in |
|
|
|
Kubernetes namespace for |
|
flag pair |
prompt, or create with |
Controls whether a missing Kubernetes namespace is created during init. |
|
flag pair |
prompt, or create with |
Controls whether missing SQL tables or MongoDB storage are created during init. |
|
|
prompt in remote mode |
Remote SSH host used when no compact remote URL is supplied. |
|
|
local SSH default |
Remote SSH username used when building remote settings. |
|
|
global default, normally |
Remote SSH port. |
|
|
global default, normally |
Project root on the remote host. |
|
|
SSH default |
Explicit SSH private key path for remote contexts and Docker watcher mode. |
|
|
auto when needed |
Watcher backend to install or reuse for remote local-sync contexts. |
|
flag |
false |
Registers a context that exists only on the remote host. No local project files are created. |
|
flag |
false |
Skips remote and Kubernetes prerequisite checks. Use when preparing files before the target exists. |
|
flag |
false |
Marks the context as critical so destructive or deployment commands ask for confirmation. |
|
flag |
false |
Accepts prompts and defaults. For production-like names without |
Behavior By Target
Target |
What |
|---|---|
Local Compose |
Local project files, provider storage, |
Remote local-sync |
Local editable project, remote context metadata, optional watcher setup, active context. |
Remote-only |
Local registry entry only. SFTPWarden checks the remote host unless |
Kubernetes manifests |
Local project plus Kubernetes deployment settings. The namespace is checked or created unless checks are skipped. |
Helm |
Local project plus Helm deployment settings. The namespace is checked or created unless checks are skipped. |
Database Storage
For SQL and MongoDB providers, init checks whether the configured table or
collection exists. If it is missing, interactive mode asks whether to create it.
With --yes, SFTPWarden creates it unless --no-create-table is provided.
When --user-schema 2 is selected for SQL providers, storage creation includes
the table needed for named keys.
When To Use It
Use init for new projects. Use sftpwarden context add only when a project
already exists and this machine just needs to register it.