TokForge TokForge
Home / Docs / Terminal guide

TokForge Terminal: User Guide (first version)

Android · TokForge 1.3.8 (beta)

Beta: this applies to TokForge 1.3.8, available on the Google Play beta track and as the Discord APK. The Play production version is 1.3.6.1.

What it is · Turning it on · The terminal screen · What you can run · Internet · Scripts and files · Using it from chat · Stopping · What it cannot do · Troubleshooting · Privacy · FAQ

What it is

The terminal is a small command shell inside TokForge. You can type commands yourself on the terminal screen, or ask the chat assistant to run a command for you. You approve every command the assistant wants to run.

What it is

What it is not

Turning it on

The terminal switch lives in the developer tools, which only show in Advanced mode.

  1. Open Settings.
  2. At the top, under "Settings Mode", choose "Advanced". (This also turns on the app-wide Advanced switch, so engine names show in the model list.)
  3. Open "Connections" (the button reads "Manage connections").
  4. Tap "Developer tools (Advanced)" to open that section.
  5. Turn on "Terminal (sandboxed)".
  6. Wait a moment while the line reads "Checking this phone...". This is the safety check: TokForge makes sure the terminal really is walled into its own folder on your phone before it lets anything run.
  7. When the check passes you see "This phone passed the safety check.", an "Open terminal" button, and the line "The assistant can run commands here when you ask, and it asks you before each one."

Below the main switch is "Allow internet in the terminal". Leave it off unless you need it (see "Internet" below).

If the check does not pass, you see "Terminal is not available on this phone:" followed by a reason, and a "Check again" button. Nothing runs on that phone. The reasons you may see:

Android 11 phones cannot run the terminal in this version. Newer Android versions passed the check on the Android 15 and 16 phones we tested.

The safety check runs again by itself after an app update or a system update. If the terminal was on, you do not need to do anything.

Turning "Terminal (sandboxed)" off ends any terminal session that is still running, and the assistant can no longer offer to run commands.

If you set "Settings Mode" back to "Basic" later, the terminal stays on and the assistant can still offer commands, but the developer tools section, with "Open terminal" and the internet switch, only shows in Advanced mode.

The terminal screen

Open it with "Open terminal" in Settings (Connections, then "Developer tools (Advanced)").

The extra key row above the keyboard

Good to know

What you can run

The shell is the phone's standard shell with TokForge's toybox tools first in line. The toolbox includes, among others:

Used on our test phones: uname -a, id, nproc, uptime, ls -la, cat, printf with sort and uniq -c, sha256sum, date -u, base64, df -h, sleep with Ctrl+C, background jobs, expr in a script, and curl to an HTTPS site.

awk and expr are not in TokForge's own toolbox. Commands the phone's own shell provides may also work; expr worked in our tests.

Pipes and redirection work as usual, for example:

printf "b\na\nb\n" | sort | uniq -c
echo hello | sha256sum
date -u

Job control works: "&" sends a command to the background, "jobs" lists them, "fg" brings one back, and Ctrl+C stops the one in front.

Your scratch home folder

Some things Android does not let apps see, so they fail in the terminal too. For example, df does not list your phone's user storage, so it cannot tell you how much free space your phone has. Use the phone's own Settings > Storage for that.

Internet

The terminal has no internet unless you allow it.

  1. In Settings, open "Connections", then "Developer tools (Advanced)".
  2. Turn on "Allow internet in the terminal". The note under it reads "Also applies to commands the assistant runs. Takes effect when the next terminal session starts."
  3. Go back to the terminal and tap "Restart". The status line now reads "Internet: on".

With internet on

With internet off, curl stops at once with "curl: (6) Could not resolve host".

Scripts and files

Write files with echo or printf:

echo "shopping: milk eggs" > notes.txt
echo "bread" >> notes.txt
printf 'echo Start\necho Done\n' > hello.sh

">" writes a new file (or replaces it), ">>" adds to the end. In printf, \n starts a new line.

Run a script with sh:

sh hello.sh

Why ./hello.sh fails: Android does not let an app run files from its own writable storage. Even after chmod +x, ./hello.sh stops with "can't execute: Permission denied" (exit code 126). sh hello.sh reads the same file and works.

Why here-documents fail: commands like cat <<EOF ... EOF need a temporary file the shell is not allowed to create here. They stop with "can't create temporary file : Permission denied". Write the file with echo or printf instead. (Run from chat, the card can still show exit code 0 when a later command in the same line succeeded, so read the output, not just the code.)

Files stay between sessions. Open the terminal later and ls -la shows everything you or the assistant wrote.

Using it from chat

When the terminal is on and your phone passed its check, the chat assistant can run one command for you. It always asks first.

How to ask

The "$ command" shortcut

The approval dialog

The 60 second rule

What you see after Run

What you see after Don't run, or no answer:

What the model is told

One command per turn

Agents do not get this tool: in 1.3.8, commands run from chat only. The three Agents presets and the other agents cannot run terminal commands.

Stopping

What it cannot do

Troubleshooting

"The terminal is off or not available on this phone."

I cannot find "Developer tools (Advanced)".

"Terminal is not available on this phone: ..."

A command runs slowly or seems stuck.

The assistant did not offer to run anything.

A Run dialog appeared when I did not ask for a command.

The model proposes a wrong command.

The model says it ran something that did not run, or the answer does not match the output.

The card shows exit code 0 but the output shows an error.

A script fails with exit code 126.

The "Ran a command" card disappeared.

HyperOS warning lines.

Privacy

FAQ

Is the terminal on by default?

No. It stays off until you turn it on, and only works where your phone passes its safety check.

Can the assistant run commands without asking me?

No. Every command needs your "Run". No answer within 60 seconds means it does not run.

Can it see my photos, files or chats?

No. It is walled into its own scratch folder. Your chats, settings, other app data and shared storage are out of reach.

Can I install Python, git or other tools?

No. There is no package manager, and TokForge never downloads programs to run.

Do my files stay?

Yes. Files in the terminal's home folder stay between sessions until you uninstall TokForge or clear its data.

Does it keep running if I leave the screen?

Yes, a session keeps running. Tap "Stop everything" or turn the switch off to end it.

Why does my Android 11 phone say it is not available?

Android 11 phones cannot set up the walls that keep the terminal in its own folder, so the terminal stays off there.

Can agents use the terminal?

Not in 1.3.8. Commands run from chat only.

Does it work with a remote model?

Yes. The approval dialog then adds "The command output will be sent to your remote model."

Why does ping not work?

The terminal only allows normal web-style connections, even with internet on. Use curl to check that a site answers.

Why did ./myscript.sh fail with "Permission denied"?

Android does not let apps run files from their own storage. Use sh myscript.sh.

Get 1.3.8

To get 1.3.8 from Google Play, open the TokForge listing and join the beta there. The Discord APK is the same version. Everyone else stays on 1.3.6.1, the Play production version.

Important: do not install an older TokForge (1.3.4.1 or earlier) over 1.3.8. It will not open, and the only way back is to uninstall, which erases your chats and settings.

The full list of changes is in the 1.3.8 changelog.