zyql-code
v0.18.6
Published
Terminal User Interface for ZYQL Code
Maintainers
Readme
ZYQL Code CLI
Terminal User Interface for ZYQL Code (智跃千里)
Installation
npm install -g zyql-codeConfiguration
After installation, configure your API settings:
zyql config # this opens up your editorThe default configuration uses OpenAI Compatible provider with ZYQL's API endpoint. You just need to add your API key.
Known Issues
Theme Detection
We don't detect the theme of your terminal, and are aware the the current theme doesn't work well on light mode terminals. Switch to the light theme using using zyql config.
Outdated dependency warnings
When installing ZYQL Code CLI you'll be greeted by some scary looking dependency deprecation warnings. We're aware of the issue and will resolve it shortly.
Windows Support
We've only tested the CLI on Mac and Linux, and are aware that there are some issues on Windows. For now, if you can, we advise you to use a WSL environment to run the CLI.
Usage
Interactive Mode
# Start interactive chat session
zyql
# Start with a specific mode
zyql --mode architect
# Start with a specific workspace
zyql --workspace /path/to/project
# Resume the last conversation from this workspace
zyql -c
# or
zyql --continueParallel mode
Parallel mode allows multiple ZYQL Code instances to work in parallel on the same directory, without conflicts. You can spawn as many ZYQL Code instances as you need! Once finished, changes will be available on a separate git branch.
# Prerequisite: must be within a valid git repository
# In interactive mode, changes will be committed on /exit
# Terminal 1
zyql --parallel "improve xyz"
# Terminal 2
zyql --parallel "improve abc"
# Pairs great with auto mode 🚀
# Terminal 1
zyql --parallel --auto "improve xyz"
# Terminal 2
zyql --parallel --auto "improve abc"Autonomous mode (Non-Interactive)
Autonomous mode allows ZYQL Code to run in automated environments like CI/CD pipelines without requiring user interaction.
# Run in autonomous mode with a prompt
zyql --auto "Implement feature X"
# Run in autonomous mode with piped input
echo "Fix the bug in app.ts" | zyql --auto
# Run in autonomous mode with timeout (in seconds)
zyql --auto "Run tests" --timeout 300Autonomous mode Behavior
When running in Autonomous mode (--auto flag):
- No User Interaction: All approval requests are handled automatically based on configuration
- Auto-Approval/Rejection: Operations are approved or rejected based on your auto-approval settings
- Follow-up Questions: Automatically responded with a message instructing the AI to make autonomous decisions
- Automatic Exit: The CLI exits automatically when the task completes or times out
Auto-Approval Configuration
Autonomous mode respects your auto-approval configuration. Edit your config file with zyql config to customize:
{
"autoApproval": {
"enabled": true,
"read": {
"enabled": true,
"outside": true
},
"write": {
"enabled": true,
"outside": false,
"protected": false
},
"execute": {
"enabled": true,
"allowed": ["npm", "git", "pnpm"],
"denied": ["rm -rf", "sudo"]
},
"browser": {
"enabled": false
},
"mcp": {
"enabled": true
},
"mode": {
"enabled": true
},
"subtasks": {
"enabled": true
},
"question": {
"enabled": false,
"timeout": 60
},
"retry": {
"enabled": true,
"delay": 10
},
"todo": {
"enabled": true
}
}
}Configuration Options:
read: Auto-approve file read operationsoutside: Allow reading files outside workspace
write: Auto-approve file write operationsoutside: Allow writing files outside workspaceprotected: Allow writing to protected files (e.g., package.json)
execute: Auto-approve command executionallowed: List of allowed command patterns (e.g., ["npm", "git"])denied: List of denied command patterns (takes precedence)
browser: Auto-approve browser operationsmcp: Auto-approve MCP tool usagemode: Auto-approve mode switchingsubtasks: Auto-approve subtask creationquestion: Auto-approve follow-up questionsretry: Auto-approve API retry requeststodo: Auto-approve todo list updates
Command Approval Patterns
The execute.allowed and execute.denied lists support hierarchical pattern matching:
- Base command:
"git"matches any git command (e.g.,git status,git commit,git push) - Command + subcommand:
"git status"matches any git status command (e.g.,git status --short,git status -v) - Full command:
"git status --short"only matches exactlygit status --short
Example:
{
"execute": {
"enabled": true,
"allowed": [
"npm", // Allows all npm commands
"git status", // Allows all git status commands
"ls -la" // Only allows exactly "ls -la"
],
"denied": [
"git push --force" // Denies this specific command even if "git" is allowed
]
}
}Interactive Command Approval
When running in interactive mode, command approval requests now show hierarchical options:
[!] Action Required:
> ✓ Run Command (y)
✓ Always run git (1)
✓ Always run git status (2)
✓ Always run git status --short --branch (3)
✗ Reject (n)Selecting an "Always run" option will:
- Approve and execute the current command
- Add the pattern to your
execute.allowedlist in the config - Auto-approve matching commands in the future
This allows you to progressively build your auto-approval rules without manually editing the config file.
Autonomous mode Follow-up Questions
In Autonomous mode, when the AI asks a follow-up question, it receives this response:
"This process is running in non-interactive Autonomous mode. The user cannot make decisions, so you should make the decision autonomously."
This instructs the AI to proceed without user input.
Exit Codes
0: Success (task completed)124: Timeout (task exceeded time limit)130: SIGINT interruption (Ctrl+C)143: SIGTERM interruption (system termination)1: Error (initialization or execution failure)
Example CI/CD Integration
# GitHub Actions example
- name: Run ZYQL Code
run: |
echo "Implement the new feature" | zyql --auto --timeout 600Local Development
Getting Started
To build and run the CLI locally off your branch:
Build the VS Code extension
cd src
pnpm bundle
pnpm vsix
pnpm vsix:unpackged
cd ..Install CLI dependencies
cd cli
pnpm install
pnpm deps:installBuild the CLI
pnpm clean
pnpm clean:kilocode
pnpm copy:kilocode
pnpm buildConfigure CLI settings
pnpm start configRun the built CLI
pnpm startUsing DevTools
In order to run the CLI with devtools, add DEV=true to your pnpm start command, and then run npx react-devtools to show the devtools inspector.
