Skip to main content

CLI Commands

init

The init command launches an interactive setup wizard to configure the Cogni+ CLI.

Usage

cogni init [OPTIONS]

Description

The init command guides you through the initial setup process for the Cogni+ CLI. It helps you configure authentication, MCP server settings, and telemetry preferences through a series of interactive prompts. This is typically the first command you should run after installing the Cogni+ CLI, as it ensures your environment is properly configured.

Options

OptionDescription
--helpShow help message for the init command

Interactive Setup Steps

The setup wizard walks you through the following steps:
  1. Authentication:
    • Checks if you’re already logged in
    • Offers to log you in if needed (using the login command)
  2. MCP Server Configuration:
    • Configures the MCP gateway server port (default: 8080)
    • Sets the service idle timeout in seconds (default: 300 seconds)
    • Configures Docker registry URL if Docker is available
  3. Telemetry Configuration:
    • Explains what anonymous telemetry data is collected
    • Allows you to enable or disable telemetry
  4. Configuration Summary:
    • Displays a summary of all configured settings
    • Shows where the configuration will be saved
    • Gives you a chance to restart the setup if needed

Configuration File

The configuration is saved to ~/.cogni/config.json by default. This file stores:
  • Authentication tokens
  • Server configuration
  • Telemetry preferences
  • Other CLI settings

Examples

# Run the interactive setup wizard
cogni init

Output

The command provides interactive prompts and clear feedback during the setup process:
Welcome to Cogni+ CLI!
This wizard will help you set up the CLI for first use.

You need to log in to use Cogni+ CLI.
Do you want to log in now? [y/N]: y

...

MCP Server Configuration
MCP gateway server port [8080]: 
Service idle timeout (seconds) [300]: 

Telemetry Configuration
Cogni+ CLI collects anonymous usage data to help improve the tool.
This includes command usage, errors, and performance metrics.
No sensitive data like tokens or personal information is collected.
Enable telemetry? [Y/n]: 

Configuration Summary
Authentication: Logged in as [email protected]
MCP Gateway Port: 8080
Service Idle Timeout: 300 seconds
Docker Registry: https://registry.cogni.plus
Telemetry: Enabled

These settings will be saved to:
  /home/user/.cogni/config.json
Do you want to save these settings? [Y/n]: 

Setup complete! Here are some commands to get started:
  cogni help          - Show available commands
  cogni server start  - Start the MCP gateway server
  cogni list-servers  - List available MCP servers

Tips

  • Run this command again any time you want to reconfigure your Cogni+ CLI setup
  • If you only want to change specific settings, you can edit the config file directly