@mmmbuto/qwen-code-termux 0.6.407-termux → 0.7.1-termux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/README.md ADDED
@@ -0,0 +1,254 @@
1
+ <div align="center">
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@mmmbuto/qwen-code-termux.svg)](https://www.npmjs.com/package/@mmmbuto/qwen-code-termux)
4
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
5
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org/)
6
+ [![Downloads](https://img.shields.io/npm/dm/@mmmbuto/qwen-code-termux.svg)](https://www.npmjs.com/package/@mmmbuto/qwen-code-termux)
7
+ [![Ko-fi](https://img.shields.io/badge/Ko--fi-Support%20me-ff5e5b?logo=ko-fi&logoColor=white)](https://ko-fi.com/dionanos)
8
+
9
+ **An open-source AI agent that lives in your terminal — Termux Edition (Android).**
10
+
11
+ <a href="https://qwenlm.github.io/qwen-code-docs/zh/users/overview">中文</a> |
12
+ <a href="https://qwenlm.github.io/qwen-code-docs/de/users/overview">Deutsch</a> |
13
+ <a href="https://qwenlm.github.io/qwen-code-docs/fr/users/overview">français</a> |
14
+ <a href="https://qwenlm.github.io/qwen-code-docs/ja/users/overview">日本語</a> |
15
+ <a href="https://qwenlm.github.io/qwen-code-docs/ru/users/overview">Русский</a> |
16
+ <a href="https://qwenlm.github.io/qwen-code-docs/pt-BR/users/overview">Português (Brasil)</a>
17
+
18
+ </div>
19
+
20
+ Qwen Code is an open-source AI agent for the terminal, optimized for **Qwen3-Coder**.
21
+ This repository/package is a **Termux-first build** that keeps upstream behavior, while fixing the parts that commonly break on Android/Termux (notably PTY and a few runtime quirks).
22
+
23
+ > **Not on Termux?** Use upstream: `npm install -g @qwen-code/qwen-code@latest` (or Homebrew).
24
+ > **On Termux?** Use this package: `npm install -g @mmmbuto/qwen-code-termux@latest`.
25
+
26
+ ![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png)
27
+
28
+ ## Why a Termux Edition?
29
+
30
+ Upstream Qwen Code targets macOS/Linux/Windows. On Android/Termux, installs may fail due to native dependency issues (PTY / build tooling) and small environment differences.
31
+
32
+ Termux Edition focuses on:
33
+
34
+ - **Android PTY support** via `@mmmbuto/node-pty-android-arm64` (optional dependency)
35
+ - **Termux runtime patches** (polyfills/quirks, clipboard behavior)
36
+ - **Termux-safe install** (avoid node-gyp/husky pitfalls where possible)
37
+ - **Tested on-device** — see [QWEN_TEST_REPORT_v0.7.1-termux.md](./QWEN_TEST_REPORT_v0.7.1-termux.md)
38
+
39
+ ## Installation (Termux / Android)
40
+
41
+ ### Prerequisites
42
+
43
+ - Termux (recommended from F-Droid)
44
+ - Node.js **20+** (Termux `nodejs-lts` is recommended)
45
+
46
+ ```bash
47
+ pkg update -y && pkg upgrade -y
48
+ pkg install -y nodejs-lts git
49
+ ```
50
+
51
+ Optional (recommended) for extra tools:
52
+
53
+ - Install the **Termux:API** Android app
54
+ - Install the Termux package:
55
+
56
+ ```bash
57
+ pkg install -y termux-api
58
+ ```
59
+
60
+ ### Install
61
+
62
+ ```bash
63
+ npm install -g @mmmbuto/qwen-code-termux@latest
64
+ qwen --version
65
+ ```
66
+
67
+ ## Quick Start
68
+
69
+ ```bash
70
+ # Start Qwen Code (interactive)
71
+ qwen
72
+
73
+ # Then, in the session:
74
+ /help
75
+ /auth
76
+ ```
77
+
78
+ On first use, you'll be prompted to sign in. You can run `/auth` anytime to switch authentication methods.
79
+
80
+ Example prompts:
81
+
82
+ ```text
83
+ What does this project do?
84
+ Explain the codebase structure.
85
+ Help me refactor this function.
86
+ Generate unit tests for this module.
87
+ ```
88
+
89
+ <details>
90
+ <summary>Click to watch a demo video (upstream)</summary>
91
+
92
+ <video src="https://cloud.video.taobao.com/vod/HLfyppnCHplRV9Qhz2xSqeazHeRzYtG-EYJnHAqtzkQ.mp4" controls>
93
+ Your browser does not support the video tag.
94
+ </video>
95
+
96
+ </details>
97
+
98
+ ## Authentication
99
+
100
+ Qwen Code supports two authentication methods:
101
+
102
+ - **Qwen OAuth (recommended & free)**: sign in with your `qwen.ai` account in a browser.
103
+ - **OpenAI-compatible API**: use `OPENAI_API_KEY` (and optionally a custom base URL / model).
104
+
105
+ ### Qwen OAuth (recommended)
106
+
107
+ Start `qwen`, then run:
108
+
109
+ ```bash
110
+ /auth
111
+ ```
112
+
113
+ Choose **Qwen OAuth** and complete the browser flow. Your credentials are cached locally so you usually won't need to log in again.
114
+
115
+ ### OpenAI-compatible API (API key)
116
+
117
+ Environment variables (recommended for CI / headless environments):
118
+
119
+ ```bash
120
+ export OPENAI_API_KEY="your-api-key-here"
121
+ export OPENAI_BASE_URL="https://api.openai.com/v1" # optional
122
+ export OPENAI_MODEL="gpt-4o" # optional
123
+ ```
124
+
125
+ For details (including `.qwen/.env` loading and security notes), see the upstream authentication guide:
126
+ https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/
127
+
128
+ ## Usage
129
+
130
+ As an open-source terminal agent, you can use Qwen Code in four primary ways:
131
+
132
+ 1. Interactive mode (terminal UI)
133
+ 2. Headless mode (scripts, CI)
134
+ 3. IDE integration (VS Code, Zed)
135
+ 4. TypeScript SDK
136
+
137
+ ### Interactive mode
138
+
139
+ ```bash
140
+ cd your-project/
141
+ qwen
142
+ ```
143
+
144
+ Run `qwen` in your project folder to launch the interactive terminal UI. Use `@` to reference local files (for example `@src/main.ts`).
145
+
146
+ ### Headless mode
147
+
148
+ ```bash
149
+ cd your-project/
150
+ qwen -p "your question"
151
+ ```
152
+
153
+ Use `-p` to run Qwen Code without the interactive UI—ideal for scripts, automation, and CI/CD. Learn more:
154
+ https://qwenlm.github.io/qwen-code-docs/en/users/features/headless
155
+
156
+ ### IDE integration
157
+
158
+ Use Qwen Code inside your editor (VS Code, Zed, and JetBrains IDEs):
159
+
160
+ - https://qwenlm.github.io/qwen-code-docs/en/users/integration-vscode/
161
+ - https://qwenlm.github.io/qwen-code-docs/en/users/integration-zed/
162
+ - https://qwenlm.github.io/qwen-code-docs/en/users/integration-jetbrains/
163
+
164
+ ### TypeScript SDK
165
+
166
+ Build on top of Qwen Code with the TypeScript SDK:
167
+
168
+ - [Use the Qwen Code SDK](./packages/sdk-typescript/README.md)
169
+
170
+ ## Commands & Shortcuts
171
+
172
+ ### Session Commands
173
+
174
+ - `/help` - Display available commands
175
+ - `/clear` - Clear conversation history
176
+ - `/compress` - Compress history to save tokens
177
+ - `/stats` - Show current session information
178
+ - `/bug` - Submit a bug report
179
+ - `/exit` or `/quit` - Exit Qwen Code
180
+
181
+ ### Keyboard Shortcuts
182
+
183
+ - `Ctrl+C` - Cancel current operation
184
+ - `Ctrl+D` - Exit (on empty line)
185
+ - `Up/Down` - Navigate command history
186
+
187
+ > Learn more about Commands:
188
+ > https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/
189
+ >
190
+ > **Tip**: In YOLO mode (`--yolo`), vision switching happens automatically without prompts when images are detected. Learn more about Approval Mode:
191
+ > https://qwenlm.github.io/qwen-code-docs/en/users/features/approval-mode/
192
+
193
+ ## Configuration
194
+
195
+ Qwen Code can be configured via `settings.json`, environment variables, and CLI flags.
196
+
197
+ - **User settings**: `~/.qwen/settings.json`
198
+ - **Project settings**: `.qwen/settings.json`
199
+
200
+ See settings docs for available options and precedence:
201
+ https://qwenlm.github.io/qwen-code-docs/en/users/configuration/settings/
202
+
203
+ ## Termux Notes
204
+
205
+ ### Storage access
206
+
207
+ To work with files under `/sdcard`, run once:
208
+
209
+ ```bash
210
+ termux-setup-storage
211
+ ```
212
+
213
+ ### Clipboard
214
+
215
+ If you installed `termux-api` + the Termux:API app, clipboard actions can use Termux-native commands.
216
+
217
+ ### PTY
218
+
219
+ On ARM64 Termux, PTY support is provided by `@mmmbuto/node-pty-android-arm64` (optional dependency).
220
+ If PTY isn't available, Qwen Code falls back to non-PTY execution where possible.
221
+
222
+ ## Changelog & Releases
223
+
224
+ - [CHANGELOG.md](./CHANGELOG.md)
225
+ - Latest Termux test report: [QWEN_TEST_REPORT_v0.7.1-termux.md](./QWEN_TEST_REPORT_v0.7.1-termux.md)
226
+
227
+ ## Troubleshooting
228
+
229
+ If you encounter issues, check the upstream troubleshooting guide:
230
+ https://qwenlm.github.io/qwen-code-docs/en/users/support/troubleshooting/
231
+
232
+ To report a bug from within the CLI, run `/bug` and include a short title and repro steps.
233
+
234
+ ### Termux-specific troubleshooting
235
+
236
+ - Make sure you are on **Node 20+** (`node -v`)
237
+ - Update packages (`pkg upgrade -y`)
238
+ - If OAuth browser flow fails, try again after `termux-open-url https://qwen.ai` (ensures the bridge is working)
239
+ - If you need Termux tools, install `termux-api` and the Android companion app
240
+
241
+
242
+ ## Support
243
+
244
+ If this Termux edition helps you, you can support the project on Ko-fi:
245
+ - https://ko-fi.com/dionanos
246
+
247
+ ## Connect with Upstream
248
+
249
+ - Discord: https://discord.gg/ycKBjdNd
250
+ - Dingtalk: https://qr.dingtalk.com/action/joingroup?code=v1,k1,+FX6Gf/ZDlTahTIRi8AEQhIaBlqykA0j+eBKKdhLeAE=&_dt_no_comment=1&origin=1
251
+
252
+ ## Acknowledgments
253
+
254
+ This project is based on [Google Gemini CLI](https://github.com/google-gemini/gemini-cli). We acknowledge and appreciate the excellent work of the Gemini CLI team. Our main contribution focuses on parser-level adaptations to better support Qwen-Coder models.