/ flydocs init

Initialize FlyDocs in a project with authentication, workspace selection, and artifact sync.

Synopsis

terminal
flydocs init [flags]

The primary setup command. Authenticates your API key, selects a workspace, pulls server configuration, and installs all managed artifacts into your project. This is the recommended way to get started with FlyDocs in any repository.

Options

Flag Type Default Description
--key string -- API key (fdk_...). Skips the interactive prompt if provided.
--project-key boolean false Store the credential in the project directory instead of globally.
--path string cwd Target directory for initialization.
--tier string -- local or cloud. Prompts interactively if omitted.
--scan boolean false Run AI scan after initialization to generate context files.
--local-source boolean false Use local templates instead of server templates. For development only.

What It Does

  1. Authenticates your API key against the relay API and stores credentials
  2. Selects workspace by prompting you to choose from available workspaces
  3. Pulls server config and creates .flydocs/config.json
  4. Syncs managed artifacts including skills, hooks, and slash commands
  5. Detects your stack from the project's package files and configuration
  6. Generates context files: project.md and service.json in flydocs/context/
  7. Updates .gitignore to exclude credential and cache files

In multi-repo workspaces, init also detects sibling repositories and creates a .flydocs-workspace.json at the workspace root with topology information.

Examples

Interactive initialization in the current directory:

terminal
flydocs init

Non-interactive with an API key and cloud tier:

terminal
flydocs init --key fdk_abc123 --tier cloud

Initialize a different directory and run a scan afterward:

terminal
flydocs init --path ./my-project --scan

Related Commands