Version 1.4.0 (current)
Build a device-summary tool
Combine Android version and display queries in your own JavaScript tool.
Build a JavaScript tool that reports the selected device's Android API level, SELinux state and display IDs. It queries the device directly without starting a model task.
Requires the system source: This tutorial's script runs from the
taku-osrepository root. Clone taku-os first.
Before you begin
Complete Your first call and prepare a connected development device. Install Android's adb debugging tool on the computer; it sends commands to the device you choose.
1. Select a device
Run in a computer terminal:
adb devices -lFind the target whose state is device. Its first column is the device serial. Replace the example emulator-5582 below with yours. For offline or unauthorized, use Connection troubleshooting first.
2. Create the script
Create my-device-summary.mjs in the taku-os system repository root:
import { TakuClient } from './sdk/client.mjs';
const serial = process.argv[2];
if (!serial) throw new Error('Pass your Android device serial');
const client = new TakuClient({ transport: 'adb', serial });
const system = await client.call('system.info');
const displays = await client.call('displays.status');
console.log(JSON.stringify({
apiLevel: system.apiLevel,
selinux: system.selinux,
displayIds: displays.displayIds,
}, null, 2));client.call() returns query data and throws on failure, so missing data cannot become a successful-looking report.
3. Run it
node my-device-summary.mjs emulator-5582Expect JSON containing apiLevel, selinux and displayIds. Values come from your device; display 0 may not be the only display.
Add a field or change the output format and run it again. For example, show the API level in an “Android API …” sentence. Start by changing output rather than device settings.
Make it a discoverable extension
The script is already useful on its own. To let the existing CLI find and run it by name, see Register a local extension for its entry function, inputs, results and permissions.
The repository's device-report example adds task status, which has stronger directory-access requirements. Read it when you need partial-success handling.
Troubleshooting
If adb is missing, install Android platform-tools and add it to PATH. Preserve specific device permission errors and check the permission guide. Do not disable SELinux to make a report succeed.
Interface details are in the SDK and CLI 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
Build your first plugin
Create a Skill/MCP greeting plugin, install it, call it through the Agent, and remove it.
Extension format and lifecycle
Use the device-report declaration to register a trusted local extension, define its call scope and Android permissions, and learn the community plugin format.