iDocs is a high-performance Swift CLI for resolving structured Apple API documentation evidence, querying Apple's documentation, rendering Markdown output, and listing technology catalogs.
The repository also contains project-scoped benchmark assets for external MCP services. Those assets exist only for comparison and validation; the shipped product runtime is CLI-only.
- Resolve Docs: Structured, agent-facing Apple API resolution through
framework,symbol,type, andmemberintent fields. - Fetch Doc: Get high-quality Markdown evidence for any canonical documentation path.
- Search Docs: Explore Apple's documentation catalog with natural-language, typo, or broad discovery queries.
- Xcode Local Docs: Access documentation already downloaded by Xcode (supports offline mode).
- Browse Technologies: Explore Apple's framework and technology catalog.
- Intelligent Caching: Layered memory and disk caching for maximum performance.
- Deterministic Source Chain:
resolveverifies candidates throughfetch;fetchandsearchusecache/local(Xcode) -> apple -> sosumifallbacks.
Requirements:
- macOS 13.0+
- Apple Silicon (
arm64)
brew install rbbtsn0w/tap/idocs
idocs --helpThe Homebrew formula is published to RbBtSn0w/homebrew-tap from the publish-homebrew job after the GitHub Release assets and both registries are verified. The job mints a short-lived tap token from the shared release-bot GitHub App using RELEASE_BOT_APP_ID and RELEASE_BOT_PRIVATE_KEY. Development integrates directly into main; scheduled publication and activation use one verified candidate and remain disabled until explicitly enabled.
Requirements:
- macOS 13.0+
- Apple Silicon (
arm64) - Node.js 20+
Normal users only need:
npm install -g @rbbtsn0w/idocs --allow-scripts=@rbbtsn0w/idocs
idocs --helpWith npm 12, the flag permits only iDocs to run its native-download postinstall;
other packages remain blocked. For npm 11 or earlier, omit the flag. The wrapper
downloads the matching CLI bundle from GitHub Releases during postinstall.
If install fails, treat it as a packaging problem and inspect the npm output.
Prerequisites:
- macOS 13.0+
- Xcode 15.0+
- Tuist:
curl -Ls https://install.tuist.io | bash
Setup and build:
- Clone the repository.
- Resolve dependencies:
tuist install
- Build through Tuist:
tuist build
- Generate project when you need Xcode:
tuist generate --no-open
The binary will be located in the build directory.
Link the locally built binary into the npm wrapper:
./scripts/tuist-silent.sh build iDocs
npm --prefix npm run link-local
npm --prefix npm link
idocs --helpLocal tgz smoke test:
TMP_DIR="$(mktemp -d)"
npm --prefix "$TMP_DIR" init -y
TGZ_FILE="$(cd npm && npm pack --silent)"
npm --prefix "$TMP_DIR" i "$(pwd)/npm/$TGZ_FILE"
IDOCS_LOCAL_BINARY="${PWD}/.deriveddata/Build/Products/Debug/idocs" \
npm --prefix "$TMP_DIR/node_modules/@rbbtsn0w/idocs" run link-local
"$TMP_DIR/node_modules/.bin/idocs" --helpIf you intentionally want a wrapper-only install for local debugging, opt out of fail-fast explicitly:
IDOCS_NPM_STRICT_INSTALL=0 npm install -g @rbbtsn0w/idocs --allow-scripts=@rbbtsn0w/idocsUnified E2E validation (link + pack paths):
./scripts/e2e-cli.sh offlineLive E2E validation (network-dependent, non-deterministic):
./scripts/e2e-cli.sh liveRelease packaging for GitHub Releases:
./scripts/release-package.shUse the helper script to run build/test/run quietly from terminal:
./scripts/tuist-silent.sh build iDocs
./scripts/tuist-silent.sh run idocs --help
./scripts/tuist-silent.sh test
./scripts/tuist-silent.sh test iDocsAdapterTests
./scripts/tuist-silent.sh test-allNotes:
- This workflow wraps
xcodebuilddirectly and prints only summary lines on success. ./scripts/tuist-silent.sh testruns the full default suite (iDocsTests+iDocsAdapterTests).- If
iDocs.xcworkspaceis missing, it attemptstuist generate --no-openautomatically. - It does not require opening Xcode IDE.
- On failures, it prints recent logs for quick diagnostics.
./scripts/tuist-silent.sh testand benchmark scripts should run serially unless you set a separateIDOCS_DERIVED_DATA_PATH, otherwise Xcode may lockbuild.db.
idocs --helpidocs search "SwiftUI"
idocs resolve --framework SwiftUI --symbol NavigationSplitView --json
idocs resolve --framework AppKit --type NSWindow --member toolbarStyle --member-kind property --json
idocs fetch "/documentation/swiftui/view"
idocs listNotes:
resolveis the P0 AI-agent-facing entry point for structured Apple API evidence.resolveoutput includescanonical_path,confidence,verified_by_fetch,evidence,candidates,resolve_diagnostics, andfetch_diagnostics.fetchremains the canonical evidence authority for known documentation paths.searchis for exploration and candidate discovery, not the primary structured correctness path.- Search output includes source markers like
{source: apple}. - Empty search output includes structured diagnostics when fallback stages miss or fail.
- JSON search output includes
search_diagnosticswith stagereasonandhintfields. - Fetch output includes a source header like
[source: local|apple|sosumi|cache]. - For source-checkout workflows, replace
idocswith./scripts/tuist-silent.sh run idocs --. - Agent and benchmark workflows can override cache or usage-log locations with
IDOCS_CACHE_PATHandIDOCS_USAGE_LOG_PATH.
Default tests (offline, no external network):
tuist test iDocs --inspect-mode local --no-upload --no-selective-testing -- -destination 'platform=macOS,name=My Mac'
./scripts/tuist-silent.sh testScoped runs:
./scripts/tuist-silent.sh test iDocsTests
./scripts/tuist-silent.sh test iDocsAdapterTestsIntegration tests (explicitly enabled):
IDOCS_INTEGRATION_TESTS=1 ./scripts/tuist-silent.sh testNotes:
- Default tests do not access external networks
- Default tests cover both CLI and Adapter test targets
- Integration tests validate live endpoints and may fail if services are unavailable
- Tuist owns the project graph through
Project.swift;Tuist/Package.swiftis only the third-party SwiftPM dependency entry point for.external(...)dependencies. - Tuist test commands should run headlessly with the shared
iDocsscheme, local inspect mode,--no-upload,--no-selective-testing, and an explicit macOS destination. - SDK repositories are the case that should expose a root
Package.swiftas their SwiftPM release contract.
./scripts/arch-gate.sh
./scripts/spec-trace-gate.sh
./scripts/coverage-gate.sh 60
./scripts/e2e-cli.sh
./scripts/benchmark/check-local-cli-latency.shNotes:
spec-trace-gate.shverifies everyFR-*/SC-*inspec.mdhas a mapped automated check.coverage-gate.shrunsxcodebuildwith coverage and evaluates average line coverage foriDocsKit,iDocsAdapter, andiDocsApp.check-local-cli-latency.shruns a local binary directly, records usage JSONL in an isolated cache/log location, and fails if the current p50/p95 thresholds regress.check-local-cli-latency.shhonorsIDOCS_LATENCY_SAMPLES,IDOCS_LATENCY_COMMAND_TIMEOUT_SECONDS,IDOCS_LATENCY_KEEP_ARTIFACTS,IDOCS_LATENCY_CACHE_DIR, andIDOCS_LATENCY_USAGE_LOGfor local diagnostics.
MIT
- Code of Conduct: CODE_OF_CONDUCT.md
- Contributing Guide: CONTRIBUTING.md
- Security Policy: SECURITY.md