GitHub - localcodeai/localcode: Local model harness project · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
localcodeai
localcode
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>17 Commits<br>17 Commits
LocalCode
LocalCode
.gitignore
.gitignore
AGENTS.md
AGENTS.md
LICENSE
LICENSE
README.md
README.md
pre-commit.sh
pre-commit.sh
View all files
Repository files navigation
LocalCode
Turn natural language into CLI commands using Apple's on-device AI.
What is this?
LocalCode is a proof-of-concept that demonstrates building CLI tools with Apple's Foundation Models framework. Tell it what you want in plain English, it suggests the right command, you approve, and it runs.
All AI processing happens locally on your Mac. No cloud, no data leaving your machine.
Requirements
Apple Silicon Mac (M1/M2/M3/M4)
macOS 26+
Xcode 26+ (for building the Swift helper)
Go (for building the TUI)
Quick Start
git clone https://github.com/localcodeai/localcode.git<br>cd localcode/LocalCode
# Build the Swift AFM helper<br>cd Sources/afmhelper<br>swiftc -o afmhelper main.swift -framework FoundationModels -target arm64-apple-macosx26.0
# Build the Go TUI<br>cd ../..<br>go build -o localcode .
# Run<br>./localcode
How It Works
You: "list all python files"<br>LocalCode: find . -name "*.py"<br>▶ Execute this command? [Enter] Run | [N] Cancel
The model translates your request into a command. You approve before it runs.
Example Commands to Try
File Operations:
"list all python files"
"find all files named hello"
"show me the largest files in this directory"
"count all files in this directory"
System & Network:
"check if port 8080 is in use"
"show git status"
Search:
"grep for hello in this directory"
All commands show a confirmation dialog before running. You can edit the command before executing, or cancel.
Project Structure
LocalCode/<br>├── main.go # Go TUI (Bubble Tea)<br>├── pre-commit.sh # Pre-commit hook<br>└── Sources/<br>└── afmhelper/ # Swift → Apple FoundationModels<br>└── main.swift
TUI Layer : Go + Bubble Tea
AI Layer : Apple FoundationModels framework (Swift)
Command Flow : Model suggests → You approve → Command executes
Development
A pre-commit hook ensures the project builds:
cp pre-commit.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit<br>git config core.hooksPath .git/hooks
Why does this exist?
Apple's Foundation Models framework is new and under-documented. This project proves it's viable for CLI tools and provides a reference implementation for others building on AFM.
Contributing
POCs have rough edges—and that's okay. Contributions welcome:
Fork and create a feature branch
Make your changes
Open a PR
License
MIT
About
Local model harness project
Resources
Readme
License
MIT license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Custom properties
Stars
star
Watchers
watching
Forks
forks
Report repository
Releases
No releases published
Packages
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Go<br>54.1%
Swift<br>36.0%
Shell<br>8.4%
Python<br>1.5%
You can’t perform that action at this time.