Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ cp target/release/autocli /usr/local/bin/ # macOS / Linux
5. 「パッケージ化されていない拡張機能を読み込む」をクリックし、解凍したフォルダを選択
6. 拡張機能は自動的に autocli daemon に接続されます

### Daemon 認証とアップグレード時の注意

- ブラウザモードのコマンドは、`~/.autocli/daemon-token` に保存されたトークンでローカル daemon に接続します
- CLI はこのトークンを自動で読み込むため、通常のローカル構成では手動コピーは不要です
- 旧バージョンの AutoCLI からアップグレードした場合は、`chrome://extensions` で unpacked extension を一度リロードして、daemon token で再接続させてください
- カスタム構成では `AUTOCLI_DAEMON_TOKEN` でトークンを上書きできます
- `autocli doctor` は daemon token のパスと daemon / 拡張機能の接続状態を表示します

> Public モードのコマンド(hackernews、devto、lobsters など)は拡張機能なしで使用できます。

## Skill インストール
Expand Down Expand Up @@ -144,6 +152,9 @@ autocli twitter search "rust lang" --limit 10
# 診断を実行
autocli doctor

# daemon token のパス / 拡張機能の接続状態を確認
# (doctor の出力に含まれます)

# シェル補完を生成
autocli completion bash >> ~/.bashrc
autocli completion zsh >> ~/.zshrc
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ Simply re-run the install command or download the latest release to overwrite th
5. Click "Load unpacked" and select the extracted folder
6. The extension will automatically connect to the autocli daemon

### Daemon Auth and Upgrade Notes

- Browser-mode commands now authenticate to the local daemon with a token stored at `~/.autocli/daemon-token`
- The CLI loads this token automatically; no manual copy/paste is required for the default local setup
- If you upgraded from an older AutoCLI build, reload the unpacked Chrome extension once in `chrome://extensions` so it reconnects with the daemon token
- For custom setups, you can override the token with `AUTOCLI_DAEMON_TOKEN`
- `autocli doctor` prints the daemon token path together with daemon and extension connectivity

> Public mode commands (hackernews, devto, lobsters, etc.) work without the extension.

## Skill Install
Expand Down Expand Up @@ -144,6 +152,9 @@ autocli twitter search "rust lang" --limit 10
# Run diagnostics
autocli doctor

# Review daemon token path / extension connectivity
# (included in doctor output)

# Generate shell completions
autocli completion bash >> ~/.bashrc
autocli completion zsh >> ~/.zshrc
Expand Down
11 changes: 11 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ cp target/release/autocli /usr/local/bin/ # macOS / Linux
5. 点击「加载已解压的扩展程序」,选择解压后的文件夹
6. 扩展安装后会自动连接 autocli daemon

### Daemon 鉴权与升级说明

- 浏览器模式命令现在会使用保存在 `~/.autocli/daemon-token` 的 token 访问本地 daemon
- CLI 会自动读取这个 token,默认本地安装场景下无需手动复制
- 如果你是从旧版 AutoCLI 升级,请到 `chrome://extensions` 里把已加载的扩展手动重载一次,让它用新的 daemon token 重新连接
- 自定义部署场景可通过 `AUTOCLI_DAEMON_TOKEN` 覆盖 token
- `autocli doctor` 会输出 daemon token 路径,以及 daemon / 扩展连接状态

> Public 模式命令(hackernews、devto、lobsters 等)无需安装扩展即可使用。

## Skill 安装
Expand Down Expand Up @@ -144,6 +152,9 @@ autocli twitter search "rust lang" --limit 10
# 运行诊断
autocli doctor

# 查看 daemon token 路径 / 扩展连接状态
# (包含在 doctor 输出中)

# 生成 Shell 补全
autocli completion bash >> ~/.bashrc
autocli completion zsh >> ~/.zshrc
Expand Down
1 change: 1 addition & 0 deletions crates/autocli-browser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mod bridge;
pub mod cdp;

pub use bridge::BrowserBridge;
pub use auth::daemon_token_path;
pub use page::DaemonPage;
pub use cdp::CdpPage;
pub use daemon::Daemon;
Expand Down
30 changes: 20 additions & 10 deletions crates/autocli-cli/src/commands/doctor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use colored::Colorize;
use autocli_browser::DaemonClient;
use autocli_browser::{daemon_token_path, DaemonClient};
use autocli_external::is_binary_installed;
use colored::Colorize;

pub async fn run_doctor() {
println!("{}", "autocli diagnostics".bold());
Expand Down Expand Up @@ -34,30 +34,40 @@ pub async fn run_doctor() {
let daemon_running = client.is_running().await;
print_check("Daemon running", daemon_running);

// 3. Check extension connected
if daemon_running {
let ext_connected = client.is_extension_connected().await;
print_check("Chrome extension connected", ext_connected);
// 3. Check local daemon token state
let token_path = daemon_token_path();
print_check("Daemon token file", token_path.exists());
println!(" Path: {}", token_path.display());

// 4. Check extension connected
let ext_connected = if daemon_running {
client.is_extension_connected().await
} else {
print_check("Chrome extension connected", false);
false
};
print_check("Chrome extension connected", ext_connected);
if daemon_running && !ext_connected {
println!(
" Hint: If you upgraded from an older AutoCLI build, reload the unpacked Chrome extension once."
);
}

// 4. Check external CLIs
// 5. Check external CLIs
println!();
println!("{}", "External CLIs:".bold());
for name in &["gh", "docker", "kubectl"] {
let installed = is_binary_installed(name);
print_check(name, installed);
}

// 5. Check CDP endpoint
// 6. Check CDP endpoint
let cdp = std::env::var("AUTOCLI_CDP_ENDPOINT").ok();
if let Some(endpoint) = cdp {
println!();
println!("CDP endpoint: {}", endpoint);
}

// 6. Print adapter stats
// 7. Print adapter stats
println!();
println!("{}", "Adapter stats:".bold());
// Will be filled in by main.rs passing registry info
Expand Down