15 releases (5 breaking)
Uses new Rust 2024
| 0.6.0 | Jan 30, 2026 |
|---|---|
| 0.5.0 | Jan 20, 2026 |
| 0.4.1 | Jan 16, 2026 |
| 0.3.1 | Jan 4, 2026 |
| 0.1.1 | Dec 28, 2025 |
#449 in Configuration
Used in 2 crates
380KB
9K
SLoC
harness-locate
Cross-platform harness path discovery for AI coding CLI tools.
Features
- Detect installed AI coding assistants (Claude Code, OpenCode, Goose, AMP Code, Copilot CLI, Crush)
- Resolve configuration paths (global and project-scoped)
- Unified MCP server configuration types
- Cross-platform support (macOS, Linux, Windows)
Quick Start
Detect Installed Harnesses
use harness_locate::{Harness, HarnessKind};
// Check all installed harnesses
for harness in Harness::installed()? {
println!("{} is installed", harness.kind());
}
# Ok::<(), harness_locate::Error>(())
Get Configuration Paths
use harness_locate::{Harness, HarnessKind, Scope};
let harness = Harness::locate(HarnessKind::ClaudeCode)?;
let config_dir = harness.config(&Scope::Global)?;
println!("Config at: {}", config_dir.display());
# Ok::<(), harness_locate::Error>(())
MCP Server Configuration
use harness_locate::{Harness, HarnessKind};
use harness_locate::mcp::{McpServer, StdioMcpServer};
let server = McpServer::Stdio(StdioMcpServer {
command: "npx".to_string(),
args: vec!["-y".to_string(), "@modelcontextprotocol/server-filesystem".to_string()],
env: Default::default(),
cwd: None,
enabled: true,
timeout_ms: None,
});
// Check compatibility
let harness = Harness::new(HarnessKind::OpenCode);
if harness.supports_mcp_server(&server) {
println!("Server is supported");
}
Supported Harnesses
| Harness | Skills | Commands | MCP | Rules | Agents |
|---|---|---|---|---|---|
| Claude Code | Yes | Yes | Yes | Yes | Yes |
| OpenCode | Yes | Yes | Yes | Yes | Yes |
| Goose | Yes | No | Yes | Yes | No |
| AMP Code | Yes | Yes | Yes | Yes | No |
| Copilot CLI | Yes | No | Yes | Yes | Yes |
| Crush | Yes | No | Yes | Yes | No |
Directory Naming Conventions
Different harnesses use different directory names. Use HarnessKind::directory_names() to query programmatically:
| Resource | OpenCode | Claude Code | Goose | AMP Code | Copilot CLI | Crush |
|---|---|---|---|---|---|---|
| Skills | skill/ |
skills/ |
skills/ |
skills/ |
skills/ |
skills/ |
| Commands | command/ |
commands/ |
- | commands/ |
- | - |
| Agents | agent/ |
agents/ |
- | - | agents/ |
- |
| Plugins | plugin/ |
plugins/ |
- | - | - | - |
Note: Rules are stored at the root level, not in a named subdirectory.
Note: OpenCode uses singular names; all others use plural.
Note: Copilot CLI uses .github/ for project-scoped agents and rules.
Resource Types
DirectoryResource
For directory-based resources (skills, commands):
path- Directory locationexists- Whether directory existsstructure- Flat or Nested layoutfile_format- Expected file format
Directory Structure Patterns
Skills use nested structure (one subdirectory per skill):
~/.config/opencode/skill/
my-skill/
SKILL.md
Commands use flat structure (files directly in directory):
~/.config/opencode/command/
my-command.md
another-command.md
This pattern applies across all harnesses that support the resource type.
ConfigResource
For file-based configuration (MCP):
file- Config file pathkey_path- JSON pointer to relevant sectionformat- JSON, YAML, etc.
License
MIT
Dependencies
~8–15MB
~306K SLoC