add jibo app thing
This commit is contained in:
12
.vitepress/cache/deps/_metadata.json
vendored
12
.vitepress/cache/deps/_metadata.json
vendored
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"hash": "88a47dfe",
|
"hash": "3aa292d4",
|
||||||
"configHash": "a8dc593e",
|
"configHash": "703c54b0",
|
||||||
"lockfileHash": "a4491b5f",
|
"lockfileHash": "a4491b5f",
|
||||||
"browserHash": "46f34afb",
|
"browserHash": "63173ae2",
|
||||||
"optimized": {
|
"optimized": {
|
||||||
"vue": {
|
"vue": {
|
||||||
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
||||||
"file": "vue.js",
|
"file": "vue.js",
|
||||||
"fileHash": "fee14db9",
|
"fileHash": "1b86ce01",
|
||||||
"needsInterop": false
|
"needsInterop": false
|
||||||
},
|
},
|
||||||
"vitepress > @vue/devtools-api": {
|
"vitepress > @vue/devtools-api": {
|
||||||
"src": "../../../node_modules/@vue/devtools-api/dist/index.js",
|
"src": "../../../node_modules/@vue/devtools-api/dist/index.js",
|
||||||
"file": "vitepress___@vue_devtools-api.js",
|
"file": "vitepress___@vue_devtools-api.js",
|
||||||
"fileHash": "0775ba1f",
|
"fileHash": "03d0fb89",
|
||||||
"needsInterop": false
|
"needsInterop": false
|
||||||
},
|
},
|
||||||
"vitepress > @vueuse/core": {
|
"vitepress > @vueuse/core": {
|
||||||
"src": "../../../node_modules/@vueuse/core/dist/index.js",
|
"src": "../../../node_modules/@vueuse/core/dist/index.js",
|
||||||
"file": "vitepress___@vueuse_core.js",
|
"file": "vitepress___@vueuse_core.js",
|
||||||
"fileHash": "59ed147d",
|
"fileHash": "b5805c48",
|
||||||
"needsInterop": false
|
"needsInterop": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
text: 'Discoveries',
|
text: 'Discoveries',
|
||||||
items: [
|
items: [
|
||||||
{ text: 'Jibo Workshop HRI 2024', link: '/Discoveries/jibohri' }
|
{ text: 'Jibo Workshop HRI 2024', link: '/Discoveries/jibohri' },
|
||||||
|
{ text: 'jibo-app.js', link: '/jibo-app' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
264
docs/jibo-app.md
Normal file
264
docs/jibo-app.md
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
# jibo-app
|
||||||
|
::: warning
|
||||||
|
This was written by AI. This is for a script that is private.
|
||||||
|
:::
|
||||||
|
|
||||||
|
A Node.js command-line interface for interacting with the Jibo robot's cloud services. It wraps the `@jibo/jibo-server-client` SDK and exposes every API endpoint — account management, loop (family group) management, media, messaging (Jot), robot provisioning, encryption keys, OTA updates, and more — as individual sub-commands.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- **Node.js** v6 or later
|
||||||
|
- npm dependencies installed (`npm install` in the parent project)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Credentials Setup
|
||||||
|
|
||||||
|
Every command requires three credentials:
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|---|---|
|
||||||
|
| `region` | Server region slug, e.g. `alpha-entrypoint` or `stg1-entrypoint` |
|
||||||
|
| `accessKeyId` | AWS-style access key ID |
|
||||||
|
| `secretAccessKey` | AWS-style secret access key |
|
||||||
|
|
||||||
|
Credentials are resolved in the following priority order (highest wins):
|
||||||
|
|
||||||
|
### 1. Command-line flags
|
||||||
|
```
|
||||||
|
-s, --serverRegion <region>
|
||||||
|
-i, --accessKeyId <id> (must be paired with -k)
|
||||||
|
-k, --secretAccessKey <key> (must be paired with -i)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Environment variables
|
||||||
|
```bash
|
||||||
|
export JIBO_SERVER_REGION=alpha-entrypoint
|
||||||
|
export JIBO_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
|
||||||
|
export JIBO_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Credentials file (default)
|
||||||
|
|
||||||
|
By default the script reads `~/.jibo/credentials.json`. Create it like so:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.jibo
|
||||||
|
cat > ~/.jibo/credentials.json <<'EOF'
|
||||||
|
{
|
||||||
|
"region": "alpha-entrypoint",
|
||||||
|
"accessKeyId": "YOUR_ACCESS_KEY_ID",
|
||||||
|
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.jibo/credentials.json
|
||||||
|
```
|
||||||
|
|
||||||
|
You can point to a different file with `-f <path>`, or disable file loading entirely with `-f ""` (then rely on env vars or flags).
|
||||||
|
|
||||||
|
> **Tip:** After running `AccountLogin` or `LoopGetRobot` you can capture the credentials output and write them directly to a file with the `-w <file>` flag.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Running the script
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node jibo-app.js [global options] <Command> [command args...]
|
||||||
|
```
|
||||||
|
|
||||||
|
Print the help/command list:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node jibo-app.js help
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Global Options
|
||||||
|
|
||||||
|
| Flag | Description |
|
||||||
|
|---|---|
|
||||||
|
| `-f, --credentialsFile <path>` | Path to credentials JSON file (default: `~/.jibo/credentials.json`) |
|
||||||
|
| `-s, --serverRegion <region>` | Override server region |
|
||||||
|
| `-k, --secretAccessKey <key>` | Secret access key (pair with `-i`) |
|
||||||
|
| `-i, --accessKeyId <id>` | Access key ID (pair with `-k`) |
|
||||||
|
| `-e, --env` | Suppress informational logs; print output as `export VAR=value` shell lines |
|
||||||
|
| `-w, --credentialsFile <path>` | Write returned credentials to a JSON file (`AccountLogin` / `LoopGetRobot` only) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### Account
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `SyncCredentials` | `<email> <password> [robotId]` | Log in and push credentials directly to a robot over the local network (WiFi or hard-wired at `172.24.84.101`) |
|
||||||
|
| `AccountCreate` | `<email> <password> [firstName] [lastName] [gender] [birthday]` | Create a new Jibo account |
|
||||||
|
| `AccountLogin` | `<email> <password>` | Log in and print credentials (use `-e -w` to capture them) |
|
||||||
|
| `AccountCreateAccessToken` | `<loopId>` | Create an access token scoped to a loop |
|
||||||
|
| `AccountActivateByCode` | `<code>` | Activate an account with an email verification code |
|
||||||
|
| `AccountAdminActivateById` | `<id>` | Admin: activate an account by ID |
|
||||||
|
| `AccountRemove` | | Delete the authenticated account |
|
||||||
|
| `AccountUpdate` | `[firstName] [lastName] [email] [gender] [birthday] [messagingAllowed] [password]` | Update account profile fields |
|
||||||
|
| `AccountUpdatePhoto` | `<filename>` | Upload a new profile photo |
|
||||||
|
| `AccountRemovePhoto` | | Remove the profile photo |
|
||||||
|
| `AccountGet` | `[ids...]` | Fetch one or more accounts by ID |
|
||||||
|
| `AccountGetAccountByAccessToken` | `<token>` | Look up an account by access token |
|
||||||
|
| `AccountSearch` | `<query>` | Search for accounts |
|
||||||
|
|
||||||
|
### Loop
|
||||||
|
|
||||||
|
A *Loop* is a family/household group that links an owner account to a Jibo robot.
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `LoopList` | `[loopId]` | List loops (or a specific loop); with `-e` prints `export JIBO_LOOP_ID=...` |
|
||||||
|
| `LoopCreate` | `<name> <robotId>` | Create a new loop |
|
||||||
|
| `LoopUpdate` | `<loopId> <name>` | Rename a loop |
|
||||||
|
| `LoopRemove` | `<loopId>` | Delete a loop |
|
||||||
|
| `LoopListMembers` | `[statusList] [typeList]` | List members of the authenticated account's loop |
|
||||||
|
| `LoopInviteMember` | `<email> <loopId>` | Invite someone to a loop by email |
|
||||||
|
| `LoopAcceptInvitation` | `<loopId>` | Accept a pending loop invitation |
|
||||||
|
| `LoopDeclineInvitation` | `<loopId>` | Decline a pending loop invitation |
|
||||||
|
| `LoopRemoveMember` | `<loopId> <memberId>` | Remove a member from a loop |
|
||||||
|
| `LoopFindOwner` | `<accountId>` | Find the loop owned by an account |
|
||||||
|
| `LoopGetRobot` | `<loopId>` | Get robot credentials for a loop; use `-e -w` to capture |
|
||||||
|
| `LoopListOwnerRobots` | `<accountId>` | List all robots owned by an account |
|
||||||
|
| `LoopClearRobot` | `<robotId>` | Disassociate a robot from its loop |
|
||||||
|
| `LoopUpdateNickname` | `<loopId> <memberId> <nickname>` | Set a member's nickname in a loop |
|
||||||
|
| `LoopUpdatePhoneticName` | `<loopId> <memberId> [phoneticName]` | Set a member's phonetic name in a loop |
|
||||||
|
| `LoopSuspendLoop` | `<loopId>` | Suspend a loop |
|
||||||
|
|
||||||
|
### Media
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `MediaCreate` | `<loopId> [filename] [path] [type] [reference] [isEncrypted]` | Upload a media file to a loop |
|
||||||
|
| `MediaGet` | `<paths...>` | Fetch metadata for one or more media items by path |
|
||||||
|
| `MediaList` | `<loopIds...>` | List all media items across one or more loops |
|
||||||
|
| `MediaRemove` | `<paths...>` | Delete one or more media items |
|
||||||
|
|
||||||
|
### Jot (Messaging)
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `JotCreateMessage` | `<loopId> [content] [path] [type] [reference] [url] [tags...]` | Post a message to a loop |
|
||||||
|
| `JotListMessages` | `<loopId> [after] [before]` | List messages in a loop (supports date-range filtering) |
|
||||||
|
| `JotMarkLoopRead` | `<loopId>` | Mark all messages in a loop as read |
|
||||||
|
| `JotMarkRead` | `<ids...>` | Mark specific messages as read |
|
||||||
|
| `JotNumberOfUnreadMessagesInLoops` | `<loopIds...>` | Get unread message counts for loops |
|
||||||
|
|
||||||
|
### Robot
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `RobotGetRobot` | `<robotId> [serialNumber]` | Fetch robot details |
|
||||||
|
| `RobotGetRobotHistory` | `<robotId> [serialNumber]` | Fetch robot history |
|
||||||
|
| `RobotUpdateRobot` | `<robotId> <key> <value>` | Update a robot property |
|
||||||
|
| `RobotUpdateLocationOverride` | `<robotId> <city> <state> <stateAbbr> <country> <lat> <lng>` | Override robot location |
|
||||||
|
| `RobotUpdateLocationOverrideClear` | `<robotId>` | Clear robot location override |
|
||||||
|
| `RobotAdminCreateRobot` | `<robotId> <serialNumber>` | Admin: register a new robot |
|
||||||
|
|
||||||
|
### OOBE (Out-of-Box Experience)
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `OOBEPrepareRobot` | `<loopId>` | Prepare a robot for first-time setup |
|
||||||
|
| `OOBESetupRobot` | `<robotId> <token>` | Complete robot first-time setup |
|
||||||
|
|
||||||
|
### Key Management
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `KeyShouldCreate` | `<loopId>` | Check whether an encryption key should be created |
|
||||||
|
| `KeyRequestSymmetricKey` | `<loopId>` | Request a symmetric encryption key |
|
||||||
|
| `KeyRestore` | `<loopId> [passwordHash]` | Restore an encryption key using a password (SHA-1 hashed internally) |
|
||||||
|
| `KeyListIncomingRequests` | `<loopId>` | List incoming key requests |
|
||||||
|
| `KeyListBinaryRequests` | `<loopId>` | List binary key requests |
|
||||||
|
|
||||||
|
### Backup
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `BackupList` | `<loopId>` | List backups for a loop |
|
||||||
|
|
||||||
|
### Person
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `PersonListHolidays` | `<loopId>` | List holidays for loop members |
|
||||||
|
|
||||||
|
### Log Admin
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `LogAdminSetLevel` | `<level> <friendlyIds...>` | Set log level for specific robot services. Level: `error\|warn\|info\|verbose\|debug\|silly` |
|
||||||
|
| `LogAdminSetLevelFromFile` | `<level> <filename>` | Same as above but reads `friendlyIds` from a file (one per line, `#` for comments) |
|
||||||
|
|
||||||
|
### ROM (Remote Operations Manager)
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `ROMCreate` | `<friendlyId>` | Create a ROM entry for a robot |
|
||||||
|
| `ROMSetupClient` | `<friendlyId>` | Set up a ROM client |
|
||||||
|
| `ROMSetupServer` | `<ipAddress>` | Set up a ROM server |
|
||||||
|
|
||||||
|
### OTA (Over-the-Air Updates)
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `SetOTATarget` | `<serial> <target>` | Assign an OTA update target filter to a robot (alphanumeric only) |
|
||||||
|
| `ClearOTATarget` | `<serial>` | Clear the OTA update target filter for a robot |
|
||||||
|
| `UpdateGetUpdateFrom` | `<subsystem> <fromVersion> [filter]` | Query available update for a subsystem/version |
|
||||||
|
|
||||||
|
### OAuth Clients Admin
|
||||||
|
|
||||||
|
| Command | Arguments | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `OauthClientsAdminListClients` | | List all OAuth clients |
|
||||||
|
| `OauthClientsAdminCreate` | `<clientId> <redirectUri> <responseType> <scope> <secret> ...` | *(Not yet implemented)* |
|
||||||
|
| `OauthClientsAdminRemove` | `<id>` | *(Not yet implemented)* |
|
||||||
|
| `OauthClientsAdminUpdate` | `[clientId] [aco] ...` | *(Not yet implemented)* |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Log in and save credentials to file
|
||||||
|
node jibo-app.js -s alpha-entrypoint -i MY_KEY_ID -k MY_SECRET \
|
||||||
|
AccountLogin user@example.com mypassword -w ~/.jibo/credentials.json
|
||||||
|
|
||||||
|
# List loops, printing loop ID as an env var
|
||||||
|
node jibo-app.js -e LoopList
|
||||||
|
|
||||||
|
# Sync credentials to a robot named "jibo-abc123" on the local network
|
||||||
|
node jibo-app.js SyncCredentials user@example.com mypassword jibo-abc123
|
||||||
|
|
||||||
|
# Upload a photo to a loop
|
||||||
|
node jibo-app.js MediaCreate LOOP_ID photo.jpg /photos/photo.jpg image/jpeg
|
||||||
|
|
||||||
|
# Post a text message to a loop
|
||||||
|
node jibo-app.js JotCreateMessage LOOP_ID "Hello from CLI"
|
||||||
|
|
||||||
|
# Set log level on specific robot services
|
||||||
|
node jibo-app.js LogAdminSetLevel debug my-service-id another-service-id
|
||||||
|
|
||||||
|
# Set OTA target for a robot
|
||||||
|
node jibo-app.js SetOTATarget ABC123456 release
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Credentials file format
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"region": "alpha-entrypoint",
|
||||||
|
"accessKeyId": "YOUR_ACCESS_KEY_ID",
|
||||||
|
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user