Skip to content

Commit 8ca10e4

Browse files
committed
format
1 parent 2f9d33c commit 8ca10e4

39 files changed

Lines changed: 1861 additions & 1687 deletions

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,56 @@ jobs:
1010
lint:
1111
name: Lint
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- uses: actions/checkout@v4
16-
16+
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: '18'
21-
cache: 'npm'
22-
20+
node-version: "18"
21+
cache: "npm"
22+
2323
- name: Install dependencies
2424
run: npm ci
25-
25+
2626
- name: Run linter
2727
run: npm run lint
2828

2929
format:
3030
name: Format Check
3131
runs-on: ubuntu-latest
32-
32+
3333
steps:
3434
- uses: actions/checkout@v4
35-
35+
3636
- name: Setup Node.js
3737
uses: actions/setup-node@v4
3838
with:
39-
node-version: '18'
40-
cache: 'npm'
41-
39+
node-version: "18"
40+
cache: "npm"
41+
4242
- name: Install dependencies
4343
run: npm ci
44-
44+
4545
- name: Check formatting
4646
run: npm run format:check
4747

4848
build:
4949
name: Build
5050
runs-on: ubuntu-latest
51-
51+
5252
steps:
5353
- uses: actions/checkout@v4
54-
54+
5555
- name: Setup Node.js
5656
uses: actions/setup-node@v4
5757
with:
58-
node-version: '18'
59-
cache: 'npm'
60-
58+
node-version: "18"
59+
cache: "npm"
60+
6161
- name: Install dependencies
6262
run: npm ci
63-
63+
6464
- name: Build
6565
run: npm run build

.github/workflows/security.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
secrets:
1111
name: Detect Secrets
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- uses: actions/checkout@v4
16-
16+
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.12"
21-
21+
2222
- name: Install detect-secrets
2323
run: |
2424
python -m pip install --upgrade pip
2525
python -m pip install detect-secrets==1.5.0
26-
26+
2727
- name: Detect secrets
2828
run: |
2929
if ! python -m detect_secrets scan --baseline .secrets.baseline \

.oxfmtrc.jsonc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
{
22
"$schema": "./node_modules/oxfmt/configuration_schema.json",
33
"experimentalSortImports": {
4-
"newlinesBetween": false
4+
"newlinesBetween": false,
55
},
66
"experimentalSortPackageJson": {
7-
"sortScripts": true
7+
"sortScripts": true,
88
},
9-
"ignorePatterns": [
10-
"dist/",
11-
"node_modules/",
12-
"package-lock.json"
13-
]
9+
"ignorePatterns": ["dist/", "node_modules/", "package-lock.json"],
1410
}

.oxlintrc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,5 @@
1414
"typescript/no-extraneous-class": "off",
1515
"unicorn/consistent-function-scoping": "off"
1616
},
17-
"ignorePatterns": [
18-
"dist/",
19-
"node_modules/",
20-
"package-lock.json"
21-
]
17+
"ignorePatterns": ["dist/", "node_modules/", "package-lock.json"]
2218
}

README.md

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ npx txtcode start
6262

6363
## Quick start
6464

65-
| Step | Command / action |
66-
|------|------------------|
67-
| 1. Configure | `txtcode auth` — pick platform, AI provider, and coding adapter |
68-
| 2. Start agent | `txtcode start` |
69-
| 3. Connect | **WhatsApp:** scan QR in terminal. **Telegram/Discord:** use bot token from config |
70-
| 4. Use | Send messages. Use `/code` for IDE adapter, `/chat` for primary LLM (default). |
65+
| Step | Command / action |
66+
| -------------- | ---------------------------------------------------------------------------------- |
67+
| 1. Configure | `txtcode auth` — pick platform, AI provider, and coding adapter |
68+
| 2. Start agent | `txtcode start` |
69+
| 3. Connect | **WhatsApp:** scan QR in terminal. **Telegram/Discord:** use bot token from config |
70+
| 4. Use | Send messages. Use `/code` for IDE adapter, `/chat` for primary LLM (default). |
7171

7272
<details>
7373
<summary><strong>First-time auth flow (expand)</strong></summary>
7474

75-
- Choose **messaging platform**: WhatsApp, Telegram, or Discord
76-
- Choose **AI provider** for chat mode: Anthropic, OpenAI, Google, or OpenRouter
77-
- Choose **coding adapter** for code mode: Claude Code, OpenAI Codex, Gemini CLI, Kiro CLI, or Ollama Claude Code
78-
- Set API keys and project path when prompted
75+
- Choose **messaging platform**: WhatsApp, Telegram, or Discord
76+
- Choose **AI provider** for chat mode: Anthropic, OpenAI, Google, or OpenRouter
77+
- Choose **coding adapter** for code mode: Claude Code, OpenAI Codex, Gemini CLI, Kiro CLI, or Ollama Claude Code
78+
- Set API keys and project path when prompted
7979
- Config is saved to `~/.txtcode/config.json`
8080

8181
</details>
@@ -84,28 +84,28 @@ npx txtcode start
8484

8585
## Commands
8686

87-
| Command | Description |
88-
|--------|-------------|
89-
| `txtcode auth` | First-time setup: platform, AI provider, coding adapter, API keys |
90-
| `txtcode start` | Start the agent (option: `--daemon`) |
91-
| `txtcode config` | Change settings without full auth |
92-
| `txtcode status` | Show connection and adapter status |
93-
| `txtcode logs [session]` | List or view session logs (see [Logs](#logs)) |
94-
| `txtcode reset` | Clear authorized user so the next user can claim access |
95-
| `txtcode logout` | WhatsApp: delete session (re-auth with new QR) |
96-
| `txtcode hard-reset` | Remove all config and auth data in `~/.txtcode` |
97-
| `txtcode stop` | Stop the agent |
98-
| `txtcode --help` | Show help |
99-
| `txtcode --version` | Show version |
87+
| Command | Description |
88+
| ------------------------ | ----------------------------------------------------------------- |
89+
| `txtcode auth` | First-time setup: platform, AI provider, coding adapter, API keys |
90+
| `txtcode start` | Start the agent (option: `--daemon`) |
91+
| `txtcode config` | Change settings without full auth |
92+
| `txtcode status` | Show connection and adapter status |
93+
| `txtcode logs [session]` | List or view session logs (see [Logs](#logs)) |
94+
| `txtcode reset` | Clear authorized user so the next user can claim access |
95+
| `txtcode logout` | WhatsApp: delete session (re-auth with new QR) |
96+
| `txtcode hard-reset` | Remove all config and auth data in `~/.txtcode` |
97+
| `txtcode stop` | Stop the agent |
98+
| `txtcode --help` | Show help |
99+
| `txtcode --version` | Show version |
100100

101101
<details>
102102
<summary><strong>Logs command options (expand)</strong></summary>
103103

104-
- `txtcode logs` — List session log files (newest first)
105-
- `txtcode logs 1` — View session by index (e.g. latest = 1)
106-
- `txtcode logs -f` — Follow latest session log (like `tail -f`)
107-
- `txtcode logs -n 100` — Show last 100 lines (default 50)
108-
- `txtcode logs --clear` — Delete all session log files
104+
- `txtcode logs` — List session log files (newest first)
105+
- `txtcode logs 1` — View session by index (e.g. latest = 1)
106+
- `txtcode logs -f` — Follow latest session log (like `tail -f`)
107+
- `txtcode logs -n 100` — Show last 100 lines (default 50)
108+
- `txtcode logs --clear` — Delete all session log files
109109

110110
Logs live in `~/.txtcode/logs/`. Old sessions are pruned after 7 days.
111111

@@ -127,17 +127,17 @@ Use **Code mode** (`/code`) to send messages to your coding adapter (e.g. Claude
127127

128128
## Supported platforms & IDEs
129129

130-
**Messaging:** WhatsApp · Telegram · Discord
130+
**Messaging:** WhatsApp · Telegram · Discord
131131

132132
**Coding adapters (code mode):**
133133

134-
| Adapter | Backend | Notes |
135-
|---------|---------|--------|
136-
| Claude Code | Anthropic API | Official Claude CLI |
137-
| OpenAI Codex | OpenAI API | Model in `~/.codex/config.toml` |
138-
| Gemini CLI | Google AI API | `gemini` CLI, optional `GEMINI_MODEL` |
139-
| Kiro CLI | AWS | Kiro subscription |
140-
| Ollama Claude Code | Local (Ollama) | Free, no API key |
134+
| Adapter | Backend | Notes |
135+
| ------------------ | -------------- | ------------------------------------- |
136+
| Claude Code | Anthropic API | Official Claude CLI |
137+
| OpenAI Codex | OpenAI API | Model in `~/.codex/config.toml` |
138+
| Gemini CLI | Google AI API | `gemini` CLI, optional `GEMINI_MODEL` |
139+
| Kiro CLI | AWS | Kiro subscription |
140+
| Ollama Claude Code | Local (Ollama) | Free, no API key |
141141

142142
**Chat mode providers:** Anthropic, OpenAI, Google (Gemini), OpenRouter
143143

@@ -147,17 +147,17 @@ Use **Code mode** (`/code`) to send messages to your coding adapter (e.g. Claude
147147

148148
Optional overrides (also set via `txtcode config`):
149149

150-
| Variable | Purpose |
151-
|----------|---------|
152-
| `AI_PROVIDER` | `anthropic` \| `openai` \| `gemini` \| `openrouter` |
153-
| `AI_API_KEY` | API key for the chosen provider |
154-
| `AI_MODEL` | Model id (e.g. `claude-sonnet-4`, `gpt-4o`) |
155-
| `IDE_TYPE` | `claude-code` \| `codex` \| `gemini-code` \| `kiro` \| `ollama-claude-code` |
156-
| `PROJECT_PATH` | Working directory for the coding adapter (default: current dir) |
157-
| `CLAUDE_MODEL` | Claude model for Claude Code adapter |
158-
| `GEMINI_MODEL` | Model for Gemini CLI |
159-
| `OLLAMA_MODEL` | Model for Ollama adapter (e.g. `gpt-oss:20b`) |
160-
| `OPENROUTER_API_KEY` | Required when `AI_PROVIDER=openrouter` |
150+
| Variable | Purpose |
151+
| -------------------- | --------------------------------------------------------------------------- |
152+
| `AI_PROVIDER` | `anthropic` \| `openai` \| `gemini` \| `openrouter` |
153+
| `AI_API_KEY` | API key for the chosen provider |
154+
| `AI_MODEL` | Model id (e.g. `claude-sonnet-4`, `gpt-4o`) |
155+
| `IDE_TYPE` | `claude-code` \| `codex` \| `gemini-code` \| `kiro` \| `ollama-claude-code` |
156+
| `PROJECT_PATH` | Working directory for the coding adapter (default: current dir) |
157+
| `CLAUDE_MODEL` | Claude model for Claude Code adapter |
158+
| `GEMINI_MODEL` | Model for Gemini CLI |
159+
| `OLLAMA_MODEL` | Model for Ollama adapter (e.g. `gpt-oss:20b`) |
160+
| `OPENROUTER_API_KEY` | Required when `AI_PROVIDER=openrouter` |
161161

162162
---
163163

@@ -167,25 +167,25 @@ Once connected, send plain text or use commands:
167167

168168
**Switch modes**
169169

170-
- ` /code` — All messages go to coding adapter
171-
- ` /chat` — All messages go to primary LLM (default)
172-
- `status` or `/status` — Adapter/connection status
173-
- `help` or `/help` — In-chat help
170+
- ` /code` — All messages go to coding adapter
171+
- ` /chat` — All messages go to primary LLM (default)
172+
- `status` or `/status` — Adapter/connection status
173+
- `help` or `/help` — In-chat help
174174

175175
**Natural language (code or chat)**
176176

177-
- *"Create a React component UserProfile with name and email props"*
178-
- *"Fix the auth bug in src/auth.ts where login fails"*
179-
- *"Add error handling to all API routes"*
180-
- *"Run the tests and paste the output"*
177+
- _"Create a React component UserProfile with name and email props"_
178+
- _"Fix the auth bug in src/auth.ts where login fails"_
179+
- _"Add error handling to all API routes"_
180+
- _"Run the tests and paste the output"_
181181

182182
---
183183

184184
## Logs
185185

186-
- **Location:** `~/.txtcode/logs/`
187-
- **Naming:** `session-YYYY-MM-DD-HHmmss.log` (one file per `txtcode start`)
188-
- **Cleanup:** Files older than 7 days are removed automatically.
186+
- **Location:** `~/.txtcode/logs/`
187+
- **Naming:** `session-YYYY-MM-DD-HHmmss.log` (one file per `txtcode start`)
188+
- **Cleanup:** Files older than 7 days are removed automatically.
189189
- **View:** `txtcode logs` to list, `txtcode logs 1` to open latest, `txtcode logs -f` to follow.
190190

191191
Verbose and debug output goes to the log file; the terminal shows only key status lines.
@@ -197,34 +197,34 @@ Verbose and debug output goes to the log file; the terminal shows only key statu
197197
<details>
198198
<summary><strong>Command not found: txtcode</strong></summary>
199199

200-
- Restart the terminal after `npm install -g txtcode`
201-
- Ensure global bin is in PATH: `npm config get prefix`
200+
- Restart the terminal after `npm install -g txtcode`
201+
- Ensure global bin is in PATH: `npm config get prefix`
202202

203203
</details>
204204

205205
<details>
206206
<summary><strong>WhatsApp QR / connection</strong></summary>
207207

208-
- Use a stable connection; try `txtcode logout` then `txtcode start` to get a new QR
209-
- Session is stored under `~/.txtcode`; don’t delete it if you want to keep the same number
208+
- Use a stable connection; try `txtcode logout` then `txtcode start` to get a new QR
209+
- Session is stored under `~/.txtcode`; don’t delete it if you want to keep the same number
210210

211211
</details>
212212

213213
<details>
214214
<summary><strong>Telegram / Discord not responding</strong></summary>
215215

216-
- Confirm bot token in `~/.txtcode/config.json` or `txtcode config`
217-
- For Telegram: ensure the bot is not blocked and you’ve started a chat with it
216+
- Confirm bot token in `~/.txtcode/config.json` or `txtcode config`
217+
- For Telegram: ensure the bot is not blocked and you’ve started a chat with it
218218

219219
</details>
220220

221221
<details>
222222
<summary><strong>AI or adapter errors</strong></summary>
223223

224-
- Check API keys and credits for the chosen provider
225-
- Code mode: ensure the CLI for your adapter is installed and in PATH (e.g. `claude`, `codex`, `gemini`, `kiro-cli`, `ollama`)
226-
- Run `txtcode status` to see current adapter and connection
227-
- Check `txtcode logs` or `~/.txtcode/logs/` for detailed errors
224+
- Check API keys and credits for the chosen provider
225+
- Code mode: ensure the CLI for your adapter is installed and in PATH (e.g. `claude`, `codex`, `gemini`, `kiro-cli`, `ollama`)
226+
- Run `txtcode status` to see current adapter and connection
227+
- Check `txtcode logs` or `~/.txtcode/logs/` for detailed errors
228228

229229
</details>
230230

0 commit comments

Comments
 (0)