Commands

Hawa Code provides a rich command-line interface supporting interactive sessions, configuration management, MCP server management, and more.

Basic Usage

hcode [prompt] [options]

By default, launching without any subcommands enters interactive session mode.

Global Options

Option Description
-c, --cwd <cwd> Set the current working directory
-d, --debug Enable debug mode
--verbose Enable verbose output mode
-ea, --enable-architect Enable the Architect tool
-p, --print Print response and exit (useful for pipes)
--dangerously-skip-permissions Skip all permission checks (Docker containers with no internet only)
-v, --version Show version number

Examples

# Start interactive session
hcode

# Execute a prompt directly
hcode "Analyze the code structure in current directory"

# Pipe input
echo "Optimize this code" | hcode -p

# Specify working directory
hcode -c /path/to/project "Explain this code"

Configuration Management (config)

Manage Hawa Code configuration items.

hcode config <subcommand>

Subcommands

get <key>

Get a configuration value.

hcode config get theme
hcode config get theme -g # Get global config

Options:

  • -g, --global - Use global configuration

set <key> <value>

Set a configuration value.

hcode config set theme dark
hcode config set theme dark -g # Set global config

Options:

  • -g, --global - Use global configuration

remove <key>

Remove a configuration item.

hcode config remove theme

Options:

  • -g, --global - Use global configuration

list

List all configuration values.

hcode config list
hcode config list -g # List global config

Options:

  • -g, --global - Use global configuration

Approved Tools Management (approved-tools)

Manage the list of approved tools.

hcode approved-tools <subcommand>

Subcommands

list

List all approved tools.

hcode approved-tools list

remove <tool>

Remove a tool from the approved list.

hcode approved-tools remove BashTool

MCP Server Management (mcp)

Configure and manage MCP (Model Context Protocol) servers.

hcode mcp <subcommand>

Subcommands

serve

Start the Hawa Code MCP server.

hcode mcp serve

add <name> <command> [args...]

Add a stdio-type MCP server.

# Add npx server
hcode mcp add my-server npx -y @modelcontextprotocol/server-filesystem /path/to/files

# Add server with environment variables
hcode mcp add my-server node server.js -e API_KEY=secret -e PORT=3000

Options:

  • -s, --scope <scope> - Configuration scope (project or global), default: project
  • -e, --env <env...> - Set environment variables (e.g., -e KEY=value)

add-sse <name> <url>

Add an SSE-type MCP server (requires specific permissions).

hcode mcp add-sse my-server http://localhost:3000/sse

Options:

  • -s, --scope <scope> - Configuration scope (project or global), default: project

remove <name>

Remove an MCP server.

hcode mcp remove my-server

Options:

  • -s, --scope <scope> - Configuration scope (project, global, or mcprc), default: project

list

List all configured MCP servers.

hcode mcp list

get <name>

Get detailed information about a specific MCP server.

hcode mcp get my-server

reset-mcprc-choices

Reset all .mcp.json server approval/rejection states (requires specific permissions).

hcode mcp reset-mcprc-choices

Update

Check for and install updates.

hcode update

This command will:

  1. Check for the latest version
  2. Automatically download and install if a new version is available
  3. Display the update result