This document provides detailed information about all available Forq CLI commands, their options, and example usage.
- repl - Start an interactive REPL session
- log - View application logs
- config - View and edit configuration
- help - Display help information
Start an interactive REPL (Read-Eval-Print Loop) session with the AI coding agent.
forq replThe repl command starts an interactive session where you can communicate with the AI assistant. The assistant can help with coding tasks, answer questions, and execute various tools to analyze and modify code.
When you start a REPL session, Forq automatically:
- Loads your configuration from global and project-specific config files
- Collects context about your project (if started in a project directory)
- Reads project-specific instructions from
FORQ.mdif present - Initializes the AI with the system prompt and context
Within the REPL session, you can use these special commands:
/help- Display available REPL commands/clear- Clear the conversation history/exitor/quit- Exit the REPL session/compact- Compact conversation history to save tokens
View logs from the application.
forq log [options]| Option | Description | Default |
|---|---|---|
-t, --type <type> |
Type of log to view (actions, error, conversation, analytics) | actions |
-n, --lines <number> |
Number of lines to display | 20 |
-a, --all |
Show all log entries | - |
The log command allows you to view different types of logs generated by Forq:
actions- Tool executions and AI actionserror- Error logs with stack tracesconversation- Complete conversation history with the AIanalytics- Usage analytics and session information
Logs are stored in the logs/ directory in your current working directory.
# View the last 20 action logs (default)
forq log
# View the last 50 error logs
forq log --type error --lines 50
# View all conversation logs
forq log --type conversation --allView and edit configuration.
forq config [options]| Option | Description |
|---|---|
-g, --global |
Use global configuration |
-p, --project |
Use project-specific configuration |
-i, --init |
Initialize a default configuration file |
-k, --key <key> |
Configuration key to get or set (dot notation) |
-v, --value <value> |
Value to set for the key (JSON format) |
-d, --delete |
Delete the specified key |
The config command lets you view and modify Forq's configuration settings. Forq uses a hierarchical configuration system:
- Global configuration:
~/.forqrc.json - Project configuration:
.forqrc.jsonin your project directory
Project-specific settings override global settings.
# Initialize global configuration
forq config --global --init
# View entire global configuration
forq config --global
# Set API key in global config
forq config --global --key apiKeys.anthropic --value "your-api-key"
# View a specific config value
forq config --project --key allowedTools
# Delete a config key
forq config --global --key preferences.theme --deleteThe configuration files use JSON format and support these main sections:
{
"apiKeys": {
"anthropic": "your-anthropic-api-key",
"openai": "your-openai-api-key"
},
"preferences": {
"model": "claude-3-opus-20240229",
"maxTokens": 4096,
"temperature": 0.7
},
"allowedTools": ["listDir", "readFile", "semanticSearch"],
"permissions": {
"bash": {
"allowed": true,
"bannedCommands": ["rm -rf", "sudo"]
}
}
}Display help information for Forq commands.
forq --help
forq [command] --help# Show general help
forq --help
# Show help for the config command
forq config --help