Skip to content

[...]#298

Closed
mrbeandev wants to merge 14 commits intosipeed:mainfrom
mrbeandev:feat/termux-support
Closed

[...]#298
mrbeandev wants to merge 14 commits intosipeed:mainfrom
mrbeandev:feat/termux-support

Conversation

@mrbeandev
Copy link
Contributor

Summary

This PR introduces official support for running PicoClaw on Android via Termux, addressing the community request in #286.

As PicoClaw is designed for ultra-low-footprint environments, Android devices are an ideal target for personal AI agents.

Key Changes

  • Interactive Manager: Added assets/scripts/picoclaw-manager.sh. This script automates the entire setup process (dependencies, architecture detection, Go version fixing, and building) for Termux users.
  • Detailed Documentation: Added docs/TERMUX_INSTALL.md. A comprehensive guide covering both the "one-line" automated install and the manual setup process.
  • README Update: Added a new "Mobile" section to the main README to make this feature easily discoverable.

Fixes

  • Automatically detects if the current Go version in Termux is slightly behind the required version in go.mod and adjusts it locally to allow successful builds on all Android devices.

Closes #286

@Leeaandrob
Copy link
Collaborator

@Zepan This PR addresses roadmap issue #286 (Android/Termux docs — priority: medium, status: In Progress) and partially #292 (Android Device Automation — priority: high). It adds an interactive Termux manager and setup guide.

+1371/-90 is substantial but includes the interactive manager + documentation. PicoClaw running on Android aligns perfectly with the "$10 hardware" mission.

Recommendation: Review and merge. Directly maps to two roadmap items, one of which is already In Progress on the board.

@AlexanderGalkin95
Copy link

Heads up: this PR has a merge conflict with #331 in pkg/tools/shell.go (denylist patterns block). Both PRs add new entries to the same denyPatterns slice in NewExecTool(). The resolution should be straightforward — just keep both sets of additions. Whichever merges second will need a small rebase.

@mrbeandev
Copy link
Contributor Author

Checked Leeaandrob's feedback.

There wasn't a code change requested in that comment itself (recommendation was to review/merge), but I did the practical follow-up and synced this branch with latest upstream/main to keep it current and avoid stale conflicts.

  • Merged upstream/main into feat/termux-support
  • Pushed latest branch tip: 9bdc524
  • Ran focused tests: go test ./pkg/tools ./pkg/channels ./pkg/config (all passing)

@Zepan
Copy link
Contributor

Zepan commented Feb 17, 2026

get it, we will check it soon!

@Zepan
Copy link
Contributor

Zepan commented Feb 17, 2026

Hi, did you run the script before? line 159 lack of a "}"

uninstall_picoclaw() {
    read -p "Are you sure you want to uninstall and delete all data? (y/N): " confirm
    if [[ "$confirm" == "y" || "$confirm" == "Y" ]]; then
        pkill -9 picoclaw
        tmux kill-session -t picoclaw 2>/dev/null
        rm "$BIN_PATH"
        rm -rf "$REPO_DIR"
        rm -rf "$HOME/.picoclaw"
        echo -e "${GREEN}[✓] PicoClaw uninstalled.${NC}"
    fi
    read -p "Press Enter to return to menu..."
<===  here lack of a "}"
network_diagnostics() {

And this script download the entire build environment onto the phone? This seems to defeat the purpose of PicoClaw's 'rapid deployment.' Ideally, it should just fetch the pre-compiled binary. Downloading hundreds of MBs of dev dependencies to build from source is both time-consuming and a waste of storage.

@mrbeandev
Copy link
Contributor Author

Thanks for catching that @Zepan! I fixed the missing } in uninstall_picoclaw() — good eye.

Regarding the build-from-source concern — you're absolutely right that downloading a full Go toolchain + building from source is heavy for a "rapid deployment" story. The manager script currently does this because goreleaser doesn't produce Android/ARM binaries yet (the ELF type and Bionic libc differences make cross-compiled binaries crash on Termux).

I have two ideas for a follow-up:

  1. Add an Android build target to goreleaser so we can ship pre-built Termux binaries (I've already prototyped this in the branch)
  2. Add a "download binary" option to the manager script that pulls a pre-built release when available, falling back to build-from-source only when no matching binary exists

For now, the build-from-source path works reliably on all Android devices I've tested (ARM64, ARM32). Happy to prioritize the pre-built binary path if you'd prefer that before merging.

Latest push: ac62d5b — also rebased on upstream/main and resolved the shell.go conflict that @AlexanderGalkin95 flagged. All tests passing.

- Added assets/scripts/picoclaw-manager.sh: Interactive installer for Termux
- Added docs/TERMUX_INSTALL.md: Comprehensive setup guide for Android users
- Updated README.md: Added mobile support section

Closes #286
This PR introduces comprehensive support for Coolify deployment and several
improvements to the Telegram channel:

Coolify Deployment:
- Added COOLIFY.md guide with 3 configuration methods.
- Added entrypoint-coolify.sh to generate config.json from environment variables.
- Added Dockerfile.coolify and docker-compose-coolify.yml optimized for Coolify.
- Support for full JSON configuration via PICOCLAW_CONFIG_JSON env var.

Telegram Enhancements:
- Persistent 'typing' indicator that repeats every 4s while AI is thinking.
- Automatic registration of bot commands (/model, /models) on startup.
- Consolidated /model command that supports 'provider/model' syntax for atomic switching.
- Dynamic /models command that shows actually configured providers and active model.

Configuration:
- Improved AgentLoop to support hot-switching models and providers without restart.

These changes improve cloud deployability and user experience in chat channels.
The root cause: Go's env.Parse() in LoadConfig reads PICOCLAW_*
environment variables AFTER loading config.json, silently overwriting
user-provided values. Dockerfile.coolify had hardcoded Gemini defaults
(PICOCLAW_AGENTS_DEFAULTS_PROVIDER=gemini) baked into the image layer,
so even when config.json correctly said 'vllm', the env vars won.

Fix:
- entrypoint-coolify.sh: When using PICOCLAW_CONFIG_JSON (Method 1), or
  mounted config (Method 2), unset all PICOCLAW_* env vars before
  calling picoclaw so the JSON file is the single source of truth.
- docker-compose-coolify.yml: Remove hardcoded gemini defaults from
  agent and doctor services.
- Updated docs header to recommend PICOCLAW_CONFIG_JSON as primary.
- Add Android/arm64 build target to .goreleaser.yaml
  Produces picoclaw_Android_arm64.tar.gz (PIE/ET_DYN binary built
  with GOOS=android, CGO_ENABLED=0, -ldflags '-s -w')

- Fix Bionic linker argv[0] duplication in cmd/picoclaw/main.go
  Android's dynamic linker inserts the full binary path as an extra
  argv[1], shifting real arguments. Detect and strip the duplicate
  when runtime.GOOS == "android".

- Simplify picoclaw-manager.sh to download-only
  Downloads the pre-compiled Android binary from GitHub Releases
  instead of building from source. No golang/git deps needed.
  Fix missing closing brace in uninstall_picoclaw().

- Update docs/TERMUX_INSTALL.md for Android binary download
- Add -ldflags '-s -w' to all release builds (26MB -> 19MB)
@mrbeandev mrbeandev closed this Feb 18, 2026
@mrbeandev mrbeandev deleted the feat/termux-support branch February 18, 2026 13:21
@TheUltimateAbsol
Copy link

Closed?

@mrbeandev
Copy link
Contributor Author

mrbeandev commented Feb 18, 2026

i received a notice saying this pr will be closed for some unknown reason , so i did it myself. dont know what's happening with this repo. i am done contributing to this repo , as its just wasting my time.

Closed?

@mrbeandev mrbeandev changed the title feat: add Android/Termux support with interactive manager and guide [...] Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Add guide for running PicoClaw on Android via Termux

5 participants