### Loop Command Examples Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Practical examples demonstrating how to use the /loop command for various tasks. ```shell /loop fix all clippy warnings in the project /loop 10 add unit tests until coverage is above 90% /loop 0 keep trying until the build passes ``` -------------------------------- ### Install Dependencies Source: https://github.com/kstost/cokacdir/blob/main/website/README.md Navigate to the website directory and install project dependencies using npm. ```bash cd website npm install ``` -------------------------------- ### Start Development Server Source: https://github.com/kstost/cokacdir/blob/main/website/README.md Start the development server to view the website locally. The server runs on http://localhost:5173. ```bash npm run dev ``` -------------------------------- ### Install Claude Code via PowerShell Script Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install-claude-code-on-windows.md Run this command in PowerShell to download and execute the Claude Code installation script. Ensure Git is installed first. ```powershell irm https://claude.ai/install.ps1 | iex ``` -------------------------------- ### Install cokacdir on Windows Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install.md Run this PowerShell command as Administrator to install cokacdir on Windows systems. ```powershell irm https://cokacdir.cokac.com/manage.ps1 | iex; cokacctl ``` -------------------------------- ### Install cokacdir on macOS/Linux Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install.md Use this command to download and execute the cokacdir installation script on macOS and Linux systems. ```bash curl -fsSL https://cokacdir.cokac.com/manage.sh | bash && cokacctl ``` -------------------------------- ### Install Codex Globally with npm Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install-codex-on-windows.md Installs the OpenAI Codex package globally on your system using npm. Ensure Node.js is installed and the execution policy is set. ```powershell npm i -g @openai/codex ``` -------------------------------- ### Example User Flow in Inline Mode Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-schedules.md Demonstrates how a user interacts with the bot in inline schedule mode, showing a task registration and its subsequent execution within the same chat session. ```text You: /start /home/alice/myproject You: Check this code for slow spots Bot: (analysis reply) You: Run the same check again in 5 minutes from a different angle Bot: (schedule registered) Five minutes later, with no further action from you: Bot: ⏰ Run the same check again in 5 minutes from a different angle Bot: (reply that builds on the earlier analysis, since it's the same session) ``` -------------------------------- ### Install COKACDIR on Windows Source: https://github.com/kstost/cokacdir/blob/main/README.md Execute this PowerShell command as an administrator to install cokacdir on Windows. It downloads and runs the management script, then launches the TUI. ```powershell irm https://cokacdir.cokac.com/manage.ps1 | iex; cokacctl ``` -------------------------------- ### Install COKACDIR on macOS/Linux Source: https://github.com/kstost/cokacdir/blob/main/README.md Use this command to download and execute the cokacdir management script on macOS and Linux systems. It installs cokacdir and launches the management TUI. ```bash curl -fsSL https://cokacdir.cokac.com/manage.sh | bash && cokacctl ``` -------------------------------- ### Run cokacdir with Slack Bot Tokens Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-setup-slack-bot.md This command starts cokacdir using Slack bot tokens. The tokens can be provided with or without the 'slack:' prefix and in any order. Multiple bots can be run concurrently by separating their token pairs. ```bash cokacdir --ccserver slack:, ``` ```bash # Explicit prefix cokacdir --ccserver slack:xoxb-1234-abcd,xapp-5678-efgh ``` ```bash # Auto-detected cokacdir --ccserver xoxb-1234-abcd,xapp-5678-efgh ``` ```bash # Running multiple bots side by side cokacdir --ccserver \ 123456:AAH-telegramtoken slack:xoxb-1234-abcd,xapp-5678-efgh ``` -------------------------------- ### Example .env.json Configuration Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-environment-variables.md Use this JSON file to set environment variables for cokacdir. Values can be strings, numbers, or booleans. This method is recommended as it persists across sessions and takes precedence over shell exports. ```json { "COKAC_CLAUDE_PATH": "/home/alice/.local/bin/claude", "COKAC_CODEX_PATH": "/opt/codex/codex", "COKAC_FILE_ATTACH_THRESHOLD": "16384", "COKACDIR_DEBUG": "1" } ``` -------------------------------- ### Claude Session Forking Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Example of how Claude's session is forked for verification within a loop. ```shell claude -p --resume --fork-session --max-turns 1 --tools "" ``` -------------------------------- ### Session Restoration Preview Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-start-session-and-clear.md This snippet shows a preview of a restored session when starting a session in a directory with a previous session. It indicates the restored path and provides a shortcut to resume the session. ```text [Claude] Session restored at `/home/user/project` Use /a1b2c3d4 to resume this session. 👤 Last user message... 🤖 AI response preview... ``` -------------------------------- ### Examples of Natural Language Schedules Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-schedules.md Use natural language to define one-time or recurring tasks. The bot understands various time formats and frequencies. ```text Check disk usage tomorrow at 9am Run the backup script in 30 minutes Check server health every weekday at 9am Clean logs every Sunday at midnight ``` -------------------------------- ### Set COKAC_FILE_ATTACH_THRESHOLD to 16KB Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-environment-variables.md Example of setting the COKAC_FILE_ATTACH_THRESHOLD environment variable to 16384 bytes. This configures the bot to send responses as file attachments when they exceed 16 KB. ```bash COKAC_FILE_ATTACH_THRESHOLD=16384 ``` -------------------------------- ### Update User Environment Path Variable Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install-claude-code-on-windows.md After installing Claude Code, execute this command in PowerShell to add the Claude Code installation directory to your user's PATH environment variable. This allows you to run 'claude' from any directory. ```powershell [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$env:USERPROFILE\.local\bin", "User") ``` -------------------------------- ### Disable Startup Greeting Messages Source: https://github.com/kstost/cokacdir/blob/main/CHANGELOG.md Startup greeting messages are now disabled by default. The bot no longer sends proactive "cokacdir started" messages to known chats. The legacy `greeting` field remains for backward compatibility but the `/greeting` command is retired. ```rust /// Startup greeting messages are disabled. The bot no longer proactively sends "cokacdir started" /// messages to every known chat on startup, and the old startup update-check helper was removed /// with that flow. The legacy `greeting` field remains in `BotSettings` so older settings files /// continue to deserialize, but `/greeting` is now a retired compatibility command that simply /// reports `Startup greeting is disabled.` instead of toggling a saved preference. ``` -------------------------------- ### Enable Inline Scheduled Tasks in .env.json Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-environment-variables.md Example of configuring the COKAC_SCHEDULE_INLINE environment variable within the .env.json file. Setting this to "1" enables scheduled tasks to run inline in the current chat session. ```json { "COKAC_SCHEDULE_INLINE": "1" } ``` -------------------------------- ### Preview Production Build Source: https://github.com/kstost/cokacdir/blob/main/website/README.md Preview the production build locally before deploying. ```bash npm run preview ``` -------------------------------- ### Build for Production Source: https://github.com/kstost/cokacdir/blob/main/website/README.md Build the website for production. The output will be generated in the dist/ directory. ```bash npm run build ``` -------------------------------- ### List Available Tools Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-tools.md Use the `/availabletools` command to see all tools the AI agent can perform, including destructive tools marked with '!!!'. ```bash Available Tools Bash !!! — Execute shell commands Read — Read file contents from the filesystem Edit !!! — Edit file contents ... Total: 20 ``` -------------------------------- ### Update Documentation References Source: https://github.com/kstost/cokacdir/blob/main/CHANGELOG.md Documentation and website settings references have been updated to describe the new `/fast` command instead of the retired `/greeting` setting. This includes details on command usage and Codex configuration. ```markdown Documentation and website settings references now describe `/fast` instead of the retired `/greeting` setting. `docs/how-to-configure-settings.md` documents `/fast`, `/fast on`, `/fast off`, and `/fast status`, including the exact Codex config flag and the "remove override to use provider default" semantics. `website/src/components/docs/sections/Settings.tsx` mirrors the same content in the generated website docs, and the built `index.html` / `website/dist/index.html` point at the updated hashed JS bundle. ``` -------------------------------- ### Set COKAC_CLAUDE_PATH Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-environment-variables.md Override the default path to the Claude CLI binary. This is useful for specifying a particular installation or when automatic resolution fails. ```bash COKAC_CLAUDE_PATH=/home/alice/.local/bin/claude ``` -------------------------------- ### Set a Custom Instruction Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-set-instructions.md Use the /instruction command followed by your desired text to set a custom instruction for the current chat. This guidance will be applied to all subsequent messages. ```bash /instruction Always respond in Korean. ``` ```bash /instruction You are a senior backend engineer. Focus on performance and security. ``` -------------------------------- ### Set PowerShell Execution Policy Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-install-codex-on-windows.md This command allows the execution of remote signed scripts in the current user's scope. It is required before installing npm packages globally. ```powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned ``` -------------------------------- ### Session Cleared Confirmation Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-start-session-and-clear.md Confirms that the current session has been cleared. It also shows the preserved working directory, indicating that the next message will start a new session in the same location. ```text Session cleared. `/home/user/project` ``` -------------------------------- ### OpenCode Session Forking Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Demonstrates the command for forking an OpenCode session for verification. ```shell opencode run --session --fork --agent plan "" ``` -------------------------------- ### Display Environment Variables Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-settings.md Prints every environment variable currently visible to the bot process, sorted alphabetically. This command is for bot owners only and should be used with caution due to security implications. It's useful for verifying environment variable loading. ```bash /envvars ``` -------------------------------- ### Cancel All Queued Messages Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Use /stopall to cancel the in-progress request and clear the entire message queue. This is useful for starting fresh. It reports the number of queued messages cleared. ```bash /stopall ``` -------------------------------- ### Loop Command Syntax Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Understand the different ways to invoke the /loop command, including specifying the number of repetitions or using unlimited repetitions. ```shell /loop → repeat up to 5 times (default) /loop → repeat up to N times /loop 0 → repeat with no upper bound (use with care) ``` -------------------------------- ### Resume Commands by Provider Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-start-session-and-clear.md Provides the specific CLI commands to resume a session for different AI providers. Use these commands in your terminal to directly access a saved session. ```text | Provider | Command | |----------|---------| | Claude | `claude --resume ` | | Codex | `codex resume ` | | Gemini | `gemini --resume ` | | OpenCode | `opencode -s ` | ``` -------------------------------- ### Download Files Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-file-transfer.md Use the /down command to download files from the server. Accepts absolute paths or relative paths if a session is active. Only single files can be downloaded. ```bash /down /home/user/report.pdf ``` ```bash /down ./output.csv ``` -------------------------------- ### View Current Instruction Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-set-instructions.md Execute the /instruction command without any arguments to display the currently set instruction for the chat. If no instruction is active, it shows a 'No instruction set' message. ```bash /instruction ``` -------------------------------- ### Toggle Queue Mode Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Use the /queue command to toggle queue mode on or off. The default is ON. Toggling reports the new state and may clear existing queued messages if switching to OFF. ```bash /queue ``` -------------------------------- ### No Active Session Message Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-start-session-and-clear.md This message is displayed when there is no active session. It indicates that `/start` has not been run or no messages have been sent yet to assign a session ID. ```text No active session. ``` -------------------------------- ### Enable Debug Logging with COKACDIR_DEBUG Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-configure-environment-variables.md Set the COKACDIR_DEBUG environment variable to '1' to enable detailed logging globally at startup. This is useful for automated runs and CI environments. The check is a strict string comparison. ```bash COKACDIR_DEBUG=1 ``` -------------------------------- ### Show Current Context Level Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-group-chat.md Displays the current setting for the shared chat log context level. ```bash /contextlevel → show current setting ``` -------------------------------- ### Cross-Provider Session Restoration Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-start-session-and-clear.md Demonstrates the bot switching to a different provider (Codex) to restore a session that was originally created with another provider. It shows the model switch and session restoration confirmation. ```text Model switched to Codex. [Codex] Session restored at `/home/user/project` ``` -------------------------------- ### Add and Remove Tools Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-tools.md Use the `/allowed` command to enable or disable specific tools for the current chat. Tool names are case-insensitive, and multiple operations can be combined. ```bash /allowed +Bash → enable Bash /allowed -WebSearch → disable WebSearch /allowed +Read -Bash → enable Read and disable Bash at once ``` -------------------------------- ### Codex Session Verification Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md Illustrates the command used for verifying Codex sessions in a read-only sandbox. ```shell codex exec --ephemeral --sandbox read-only ``` -------------------------------- ### Execute Shell Commands Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-shell-commands.md Prefix a message with '!' to execute a shell command directly on the server. The command runs in the current session's working directory or falls back to the home directory. ```shell !ls -la ``` ```shell !git status ``` ```shell !cat config.json ``` -------------------------------- ### Configure Co-work Behavior Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-group-chat.md Specifies the file path for customizing bot collaboration guidelines in group chats. Changes affect subsequent messages. ```bash ~/.cokacdir/prompt/cowork.md ``` -------------------------------- ### Set Context Level Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-group-chat.md Configures the number of recent log entries to include in the bot's system prompt. A higher number improves coordination but increases token usage. ```bash /contextlevel 20 → include the last 20 log entries ``` -------------------------------- ### View Existing Schedules Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-schedules.md Ask the bot to list all currently active schedules using simple commands. ```text Show my schedules What schedules do I have? ``` -------------------------------- ### Using /query for AI Messages Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-group-chat.md The '/query' command can be used to send messages to the AI. It supports broadcasting to all bots or targeting a specific bot with '@botname'. ```text /query check the server status → all bots receive /query@mybot check the server status → only @mybot receives ``` -------------------------------- ### Queue Mode Status ON Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md This message indicates that queue mode is currently ON. Messages sent while the AI is busy will be queued and processed in order. ```text 📋 Queue mode: ON Messages sent while AI is busy will be queued and processed in order. ``` -------------------------------- ### BotSettings with Per-Chat Codex Fast Map Source: https://github.com/kstost/cokacdir/blob/main/CHANGELOG.md The `BotSettings` struct now includes a `codex_fast` HashMap for per-chat settings, persisted to `bot_settings.json`. This map stores the fast service tier status for each chat. Older settings files without this field will load cleanly into an empty map. ```rust /// `BotSettings` gains a per-chat `codex_fast: HashMap` map persisted to `bot_settings.json`. /// `load_bot_settings` reads the new field with the same tolerant object-deserialization /// pattern as the existing per-chat maps, so older settings files that do not contain /// `codex_fast` load cleanly into an empty map. `save_bot_settings` writes the field back /// alongside `effort` and `claude_effort`, keeping the on-disk schema explicit for tools /// that inspect the settings file. Runtime access goes through `is_codex_fast(settings, chat_id)`, /// which defaults to `false` when no override exists. ``` -------------------------------- ### Targeted vs. Broadcast Slash Commands Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-use-group-chat.md Slash commands can be broadcast to all bots or targeted to a specific bot using '@botname'. Use '@botname' for precise control. ```text /pwd → all bots respond @mybot /pwd → only @mybot responds ``` -------------------------------- ### Redirect Behavior - First Redirect Source: https://github.com/kstost/cokacdir/blob/main/docs/how-to-manage-requests.md This message appears when queue mode is OFF and a new prompt is sent while the AI is busy. It indicates that the current task is being cancelled to process the new message. ```text 🔄 Cancelling current task, will process: "preview..." ```