{"id":48766512,"url":"https://github.com/rudrankriyam/foundation-models-framework-cli","last_synced_at":"2026-04-17T12:00:49.274Z","repository":{"id":350659922,"uuid":"1207701252","full_name":"rudrankriyam/Foundation-Models-Framework-CLI","owner":"rudrankriyam","description":"A powerful command-line interface for Foundation Models on Apple platforms.","archived":false,"fork":false,"pushed_at":"2026-04-11T11:53:27.000Z","size":85,"stargazers_count":47,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-15T10:07:10.144Z","etag":null,"topics":["apple-intelligence","cli","developer-tools","foundation-models","llm","macos","swift","swift-package"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudrankriyam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["rudrankriyam"]}},"created_at":"2026-04-11T09:28:15.000Z","updated_at":"2026-04-14T23:25:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rudrankriyam/Foundation-Models-Framework-CLI","commit_stats":null,"previous_names":["rudrankriyam/foundation-models-framework-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rudrankriyam/Foundation-Models-Framework-CLI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrankriyam%2FFoundation-Models-Framework-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrankriyam%2FFoundation-Models-Framework-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrankriyam%2FFoundation-Models-Framework-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrankriyam%2FFoundation-Models-Framework-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudrankriyam","download_url":"https://codeload.github.com/rudrankriyam/Foundation-Models-Framework-CLI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrankriyam%2FFoundation-Models-Framework-CLI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-intelligence","cli","developer-tools","foundation-models","llm","macos","swift","swift-package"],"created_at":"2026-04-13T08:02:10.683Z","updated_at":"2026-04-17T12:00:49.242Z","avatar_url":"https://github.com/rudrankriyam.png","language":"Swift","funding_links":["https://github.com/sponsors/rudrankriyam"],"categories":[],"sub_categories":[],"readme":"# Foundation Models Framework CLI\n\n`afm` is a native command-line interface for Foundation Models on Apple platforms.\n\nIt is built for day-to-day work with Foundation Models: checking model readiness, trying prompts, streaming responses, extracting structured data, validating tool manifests, and exporting artifacts you can keep or automate around.\n\n## Install\n\nHomebrew is the primary install path:\n\n```bash\nbrew tap rudrankriyam/tap\nbrew install afm\n```\n\nTagged releases update the tap automatically.\n\nIf you want to build it yourself:\n\n```bash\ngit clone https://github.com/rudrankriyam/Foundation-Models-Framework-CLI.git\ncd Foundation-Models-Framework-CLI\nswift build -c release\n.build/release/afm --help\n```\n\nTo run live model commands, you still need a supported Apple Intelligence Mac. File-based workflows, dry-runs, schema inspection, and tool validation are still useful when the on-device model is unavailable.\n\n## Why `afm`\n\n- It gives Foundation Models a direct command-line workflow for prompting, tagging, schemas, tools, transcripts, and feedback.\n- It is built for real terminal use: explicit flags, readable help, file-based inputs, and clean JSON output.\n- It works well in automation and agent flows with dry-runs, stdin support, schema and tool directories, and NDJSON-style streaming events.\n- It keeps important runtime controls close at hand, including use cases, guardrails, schema prompting, and feedback issues.\n\n## First Commands\n\nThese are good starting points after install:\n\n```bash\nafm model status\nafm session respond --prompt \"Summarize Foundation Models in one paragraph.\"\nafm session stream --prompt \"Write a short poem about rain.\"\nafm tag run --prompt \"A joyful dog playing in a sunny park.\"\nafm schema run typed-person --input \"Alex Rivera is a designer in Berlin.\"\nafm schema run custom --schema person-card --schema-dir .afm/schemas --input @person.txt\n```\n\n## Sample Workflows\n\n### Check the model\n\nUse `afm model` when you want to know what the system can do right now.\n\n```bash\nafm model status\nafm model status --use-case content-tagging\nafm model languages\nafm model use-cases\nafm model guardrails\n```\n\n### Try prompts and chat\n\nUse `afm session` for one-shot prompting, streaming, and shared-context conversations.\n\n```bash\nafm session respond --prompt \"Summarize Foundation Models in one paragraph.\"\nafm session respond --prompt @prompt.txt\nafm session respond --use-case content-tagging --prompt \"Organize this photo library item.\"\nafm session stream --prompt \"Write a short poem about rain.\"\nafm session chat --message \"Hello\" --message \"Now answer in French.\"\n```\n\n### Try content tagging\n\nUse `afm tag` when you specifically want the content-tagging system model instead of general prompting.\n\n```bash\nafm tag run --prompt \"A joyful dog playing in a sunny park.\"\n```\n\n### Extract structured data\n\nUse `afm schema` when you want the model to return data in a predictable shape.\n\n```bash\nafm schema list\nafm schema run typed-person --input \"Alex Rivera is a designer in Berlin.\"\nafm schema run basic-object --preset product\nafm schema run array-schema --preset todo\nafm schema run enum-schema --preset sentiment\nafm schema run custom --schema person-card --schema-dir .afm/schemas --input @person.txt\nafm schema run custom --schema person-card --input @person.txt --no-include-schema-in-prompt\n```\n\n### Inspect and call tool manifests\n\nUse `afm tool` to validate file-backed tools before wiring them into larger flows.\n\n```bash\nafm tool inspect --tool echo-json --tool-dir .afm/tools\nafm tool validate --tool echo-json --tool-dir .afm/tools\nafm tool call --tool echo-json --tool-dir .afm/tools --args @args.json\n```\n\n### Export transcripts and feedback\n\nUse export commands when you want artifacts you can keep, diff, or send elsewhere.\n\n```bash\nafm transcript export --message \"Hello\" --message \"Summarize our conversation.\" --file transcript.json\nafm feedback export --prompt \"What is the capital of France?\" --sentiment positive --issue incorrect --file feedback.json\n```\n\n## Files, Pipes, And Automation\n\n`afm` is designed to work well with files, pipes, and agent-style automation:\n\n```bash\nafm session respond --prompt @prompt.md\ncat prompt.md | afm session respond --output json\nafm schema run custom --schema person-card --schema-dir .afm/schemas --input @person.txt\nafm tool call --tool echo-json --tool-dir .afm/tools --args @args.json\n```\n\nBare schema and tool identifiers are resolved through `--schema-dir` and `--tool-dir`, which default to `.afm/schemas` and `.afm/tools`.\n\n## Output And Streaming\n\n`afm` defaults to text in an interactive terminal and JSON when piped or used in automation:\n\n```bash\nafm model status --output text\nafm model status --output json --pretty\n```\n\nStreaming JSON output is emitted as newline-delimited event objects so scripts and agents can react incrementally instead of waiting for one final blob:\n\n```bash\nafm session stream --output json --prompt \"Reply with three short lines.\"\nafm session chat --stream --output json --message \"Hello\" --message \"Keep going.\"\n```\n\n## Foundation Models Controls\n\n`afm` surfaces the important Foundation Models knobs directly:\n\n```bash\nafm model use-cases\nafm model guardrails\n\nafm session respond --use-case general --guardrails default --prompt \"Summarize this.\"\nafm tag run --guardrails permissive-content-transformations --prompt \"A stormy beach at sunset.\"\n\nafm schema run custom \\\n  --schema person-card \\\n  --input @person.txt \\\n  --no-include-schema-in-prompt\n\nafm feedback export \\\n  --prompt \"What is the capital of France?\" \\\n  --issue incorrect \\\n  --issue-explanation \"The answer should be Paris.\" \\\n  --file feedback.json\n```\n\nSupported use cases:\n\n- `general`\n- `content-tagging`\n\nSupported guardrails:\n\n- `default`\n- `permissive-content-transformations`\n\n## Design Goals\n\n- Long-form flags in docs and examples so commands stay readable\n- Human-readable output in a terminal, JSON when piped\n- NDJSON-style event streaming for agents and scripts\n- File-based schemas and tools instead of “edit Swift and rebuild”\n- Foundation Models concepts like use cases, guardrails, schema prompting, and feedback issues mapped directly into the CLI\n- Validation errors that fail early instead of silently doing the wrong thing\n\n## Local Development\n\n```bash\nswift build\nswift test\nswift run afm --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudrankriyam%2Ffoundation-models-framework-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudrankriyam%2Ffoundation-models-framework-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudrankriyam%2Ffoundation-models-framework-cli/lists"}