Files
chrome-use/cli/src/doctor/config.rs
T
leeguooooo 61060486f4
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
rebrand: agent-browser-stealth → chrome-use, de-fork, reset to v1.0.0
Standalone product rename across the whole repo (issue: project identity):

- Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use
  (single binary name `chrome-use`; old aliases agent-browser/abs dropped).
- Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter).
- Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use
  (CLI + ab-connect extension in lockstep — this is a breaking handshake change,
  extension bumped 0.4.2 → 0.5.0, needs a Web Store republish).
- Config dir: ~/.agent-browser → ~/.chrome-use.
- README/zh: reframed from "stealth fork of agent-browser" to a standalone
  product with a small `originally based on vercel-labs/agent-browser` credit.
- Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming
  them would break every existing script/skill for no user-facing gain).

Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to
vercel-labs/agent-browser preserved.
2026-06-12 12:56:21 +09:00

91 lines
2.9 KiB
Rust

//! Check user config files: `~/.chrome-use/config.json`,
//! `./chrome-use.json`, and any file referenced by
//! `AGENT_BROWSER_CONFIG`.
use std::env;
use std::path::PathBuf;
use super::helpers::parse_json_file;
use super::{Check, Status};
pub(super) fn check(checks: &mut Vec<Check>) {
let category = "Config";
let user_path = dirs::home_dir().map(|d| d.join(".chrome-use").join("config.json"));
if let Some(p) = user_path {
if p.exists() {
match parse_json_file(&p) {
Ok(_) => checks.push(Check::new(
"config.user",
category,
Status::Pass,
format!("{} (valid JSON)", p.display()),
)),
Err(e) => checks.push(
Check::new(
"config.user",
category,
Status::Fail,
format!("{}: {}", p.display(), e),
)
.with_fix(format!("edit {}", p.display())),
),
}
}
}
let project_path = PathBuf::from("chrome-use.json");
if project_path.exists() {
match parse_json_file(&project_path) {
Ok(_) => checks.push(Check::new(
"config.project",
category,
Status::Pass,
format!("{} (valid JSON)", project_path.display()),
)),
Err(e) => checks.push(
Check::new(
"config.project",
category,
Status::Fail,
format!("{}: {}", project_path.display(), e),
)
.with_fix(format!("edit {}", project_path.display())),
),
}
}
if let Ok(custom) = env::var("AGENT_BROWSER_CONFIG") {
let p = PathBuf::from(&custom);
if !p.exists() {
checks.push(
Check::new(
"config.custom",
category,
Status::Fail,
format!("AGENT_BROWSER_CONFIG points to missing file: {}", custom),
)
.with_fix("update or unset AGENT_BROWSER_CONFIG"),
);
} else {
match parse_json_file(&p) {
Ok(_) => checks.push(Check::new(
"config.custom",
category,
Status::Pass,
format!("AGENT_BROWSER_CONFIG: {} (valid JSON)", custom),
)),
Err(e) => checks.push(
Check::new(
"config.custom",
category,
Status::Fail,
format!("AGENT_BROWSER_CONFIG: {}: {}", custom, e),
)
.with_fix(format!("edit {}", custom)),
),
}
}
}
}