Version 1.4.0 (current)
CLI and SDK reference
Choose a computer terminal, JavaScript, or device shell entry point and check its arguments and return behavior.
The CLI is the command-line interface; the SDK is the JavaScript client library. Complete the quickstart for your first connection. Use this page to look up arguments and return behavior.
Host CLI
Requires the system source: The host CLI and JavaScript SDK run from the
taku-osrepository root. Clone taku-os first.
Run commands from the taku-os system repository root on your computer. This is syntax notation: replace METHOD, ID, and PATH; brackets mark optional arguments and are not typed.
node sdk/cli/taku.mjs call METHOD [--transport adb|device] [--serial ID] [--adb PATH]
node sdk/cli/taku.mjs extension ID [--transport adb|device] [--serial ID] [--adb PATH]| Parameter | Purpose |
|---|---|
--transport | adb connects from the computer; device runs in an Android shell environment. Omitting it does not discover a device |
--serial | The target ADB identifier, obtained from adb devices -l |
--adb | Path to the ADB executable when it is not on the default PATH |
For example, read the method list without a device, then query a connected device:
node sdk/cli/taku.mjs call methods.list
node sdk/cli/taku.mjs call system.info --transport adb --serial emulator-5582Replace the example emulator-5582 with your target. Environment variables TAKU_OS_TRANSPORT and TAKU_OS_SERIAL are also supported; setting only the environment variable TAKU_OS_SERIAL defaults to ADB. The command-line --serial flag alone does not select a transport; pass --transport adb alongside it, as in the example. The CLI does not accept arbitrary method arguments. Current method params must be an empty object.
JavaScript SDK
Save this as an .mjs file in the system repository root and run it with Node.js. After replacing the serial, the SDK returns the system.info result:
import {TakuClient} from './sdk/client.mjs';
const client = new TakuClient({transport:'adb', serial:'emulator-5582'});
const info = await client.call('system.info');
console.log(info);The SDK returns result on success and throws TakuError on failure. See your first development example for a complete program and error handling. The generated SDK protocol is the method and field reference.
Device shell facade
The device shell entry point consists of scripts running directly on Android, without phone-side Node.js. Run these commands inside the Android shell, only after the preview environment has deployed the scripts to this path:
sh /data/local/tmp/taku-os/taku-device.sh system.info
sh /data/local/tmp/taku-os/taku-device.sh displays.status
sh /data/local/tmp/taku-os/taku-device.sh tasks.statusThis is a historical experimental deployment path. Ordinary phones do not automatically contain these files. Do not run these three sh commands directly in your computer terminal.
How to recognize success
| Entry point | Success | Failure |
|---|---|---|
Host call command | Complete response with ok: true and result | ok: false and error; exit code 1 |
| JavaScript SDK | Returns result | Throws TakuError |
| Device shell entry point | Complete taku/0.1 response | Unknown method exits 2; permission denial may exit 4 |
Host extension command | Aggregated extension result | Successful items may be retained; nonempty result.errors sets exit code 1 even with outer ok: true |
Inspect the response and exit code together. For extension reports, check each individual result; see device-report. For error meanings, see the error reference.
Research preview · Current availability
Report an issue or give feedback
Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.
Built with Fumadocs