domo-cli

Version, currently 0.5.02 versions

github.com/maiha/domo-cli

The Domo Command Line Interface

1 stars
0 dependents
License: MIT

Nothing has been indexed for 0.5.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  domo-cli:
    github: maiha/domo-cli
    version: ~> 0.5.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.5.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

domo-cli Build Status

The Domo Command Line Interface built as a static x86_64 binary.

$ domo-cli dataset import <DATASET_ID> -f data.csv

Installation

  • x86_64 static binary: https://github.com/maiha/domo-cli/releases

OAuth 2.0

The Domo API uses OAuth 2.0 authentication. domo-cli accepts authentication information by environment variables or arguments.

$ export DOMO_CLIENT_ID=foo
$ export DOMO_CLIENT_SECRET=bar
$ domo-cli ... --client-id=foo --client-secret=bar

The following usages assume that credentials have been granted in one of the above ways.

Usage

domo-cli is itself built as a RESTful design and executed with RESOURCE and ACTION as arguments.

Dataset

  • Available actions : list, create, update, import, get, delete
$ domo-cli dataset list
$ domo-cli dataset create -f meta.json
$ domo-cli dataset update -f meta.json
$ domo-cli dataset import <DATASET_ID> -f data.csv
$ domo-cli dataset get    <DATASET_ID>
$ domo-cli dataset delete <DATASET_ID>

Token

Althoug domo-cli will automatically update OAuth tokens when it is expired, you can manually update it by token authorize.

$ domo-cli token authorize --client-id=5e847... --client-secret=52ccf...

$ domo-cli token show
fetched at : 2020-06-03 02:09:54 +09:00
expired at : 2020-06-03 03:09:53 +09:00
token      : eyJhbGciOiJSUzI1NiIs...

The token file is stored in .domo directory in default. See the Outdir for details.

Outdir

Internally, domo-cli executes the API with a series of shell commands. And it creates following files in the output directory.

  • the authentication tokens
  • history of executed shell commands
  • intermediate files needed to execute the API

The directory can be specified with the "-O " option, which defaults to .domo.

Dryrun

domo-cli is a thin wrapper for cURL. It shows a cURL shell command by "-n" arg.

$ domo-cli dataset get <DATASET_ID> -n

Roadmap

  • token
    • [x] authorize
    • [x] show
  • dataset
    • [x] create
    • [x] update
    • [x] import
    • [x] delete
    • [x] list
    • [x] get

Development

$ make
$ make test

Contributing

  1. Fork it (https://github.com/maiha/domo-cli/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • maiha - creator and maintainer