{"id":15651830,"url":"https://github.com/phstc/influxdb-cli","last_synced_at":"2026-03-08T21:37:39.054Z","repository":{"id":12516111,"uuid":"15185897","full_name":"phstc/influxdb-cli","owner":"phstc","description":"Ruby CLI for InfluxDB","archived":false,"fork":false,"pushed_at":"2021-06-28T14:59:13.000Z","size":46,"stargazers_count":31,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-04T03:48:52.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phstc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-14T13:18:51.000Z","updated_at":"2023-08-19T07:04:43.000Z","dependencies_parsed_at":"2022-09-16T23:21:55.450Z","dependency_job_id":null,"html_url":"https://github.com/phstc/influxdb-cli","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/phstc/influxdb-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2Finfluxdb-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2Finfluxdb-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2Finfluxdb-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2Finfluxdb-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phstc","download_url":"https://codeload.github.com/phstc/influxdb-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2Finfluxdb-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30274789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:40:19.117Z","updated_at":"2026-03-08T21:37:39.009Z","avatar_url":"https://github.com/phstc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"InfluxDB-CLI\n============\n\nRuby CLI for InfluxDB is a simple Ruby console (empowered with [Pry](https://github.com/pry/pry)) connected to an InfluxDB server using given parameters. In order to connect to InfluxDB, it uses [influxdb-ruby](https://github.com/influxdb/influxdb-ruby), so you can access any available method from influxdb-ruby in the console through the `db` variable i.e.: `db.write_point(name, data)`, `db.query('SELECT value FROM response_times')` etc.\n\n[![Build Status](https://secure.travis-ci.org/phstc/influxdb-cli.png)](http://travis-ci.org/phstc/influxdb-cli)\n\n### Installation\n```shell\ngem install influxdb-cli\n```\n\n### Options\n\n```shell\n$ influxdb-cli help db\n\nUsage:\n  influxdb-cli db\n\nOptions:\n      [--host=HOST]                      # Hostname\n                                         # Default: localhost\n      [--port=PORT]                      # Port\n                                         # Default: 8086\n  -u, [--username=USERNAME]              # Username\n                                         # Default: root\n  -p, [--password=PASSWORD]              # Password\n                                         # Default: root\n  -d, [--database=DATABASE]              # Database\n                                         # Default: db\n      [--pretty=PRETTY]                  # Human readable times (UTC)\n      [--ssl], [--no-ssl]                # Connect using TLS/SSL\n      [--time-precision=TIME_PRECISION]  # Time precision can be set to either \"s\" for seconds, \"ms\" for milliseconds, or \"u\" for microseconds\n                                         # Default: s\n```\n\n### Usage\n\n#### Connect to a database\n\n```shell\n$ influxdb-cli\nConnecting to {\"host\"=\u003e\"localhost\", \"port\"=\u003e8086, \"username\"=\u003e\"root\", \"password\"=\u003e\"root\", \"database\"=\u003e\"db\"}\n✔ ready\n```\n\nor\n\n```shell\n$ influxdb-cli -u user -p password -d database --host sandbox.influxdb.org --port 9061\nConnecting to {\"host\"=\u003e\"sandbox.influxdb.org\", \"port\"=\u003e\"9061\", \"username\"=\u003e\"username\", \"password\"=\u003e\"password\", \"database\"=\u003e\"database\"}\n✔ ready\n```\n\n[InfluxDB Playground](http://play.influxdb.org) :metal:\n\n#### Create a database and user\n\n```ruby\n2.0.0 (main)\u003e db.create_database 'db'\n2.0.0 (main)\u003e db.create_database_user 'db', 'root', 'root'\n```\n\n#### List databases\n\n```ruby\n2.0.0 (main)\u003e db.list_databases\n```\n\n#### Switch databases\n\n```ruby\n2.0.0 (main)\u003e use other_database\n2.0.0 (main)\u003e db.database\n=\u003e \"other_database\"\n```\n\n#### Write a point\n\n```ruby\n2.0.0 (main)\u003e db.write_point('tests', { message: 'Hello Pablo' })\n\n2.0.0 (main)\u003e SELECT * FROM tests\n\n+---------------+-----------------+-------------+\n|                     tests                     |\n+---------------+-----------------+-------------+\n| time          | sequence_number | message     |\n+---------------+-----------------+-------------+\n| 1387287723816 | 1               | Hello Pablo |\n+---------------+-----------------+-------------+\n1 result found for tests\n\nQuery duration: 0.0s\n```\n\n#### Return the last point from every time series in the database\n\n```ruby\n2.0.0 (main)\u003e SELECT * FROM /.*/ LIMIT 1\n```\n\nor to get only the name from every time series in the database.\n\n```ruby\n2.0.0 (main)\u003e db.query('SELECT * FROM /.*/ LIMIT 1').keys\n=\u003e [\n    [0] \"tests\",\n    [1] \"response_times\",\n    [2] \"deploys\",\n    [3] \"...\"\n]\n```\n\n\n#### Query with a [tabularized output](https://github.com/visionmedia/terminal-table)\n\n```ruby\n2.0.0 (main)\u003e SELECT * FROM deploys\n+---------------+-----------------+-----------------+--------+-----------------+-------------------+----------+\n|                                                    deploys                                                  |\n+---------------+-----------------+-----------------+--------+-----------------+-------------------+----------+\n| time          | sequence_number | application     | branch | latest_revision | previous_revision | stage    |\n+---------------+-----------------+-----------------+--------+-----------------+-------------------+----------+\n| ...           | ...             | ...             | ...    | ...             | ...               | ...      |\n+---------------+-----------------+-----------------+--------+-----------------+-------------------+----------+\n\n1 result found for deploys\n\nQuery duration: 0.49s\n```\n\n#### Query with a [Ruby Hash output](https://github.com/michaeldv/awesome_print)\n\n```ruby\n2.0.0 (main)\u003e db.query('SELECT * FROM deploys')\n=\u003e {\n     \"deploys\" =\u003e [\n        [ 0] {\n                         \"time\" =\u003e \"...\",\n              \"sequence_number\" =\u003e \"...\",\n                  \"application\" =\u003e \"...\",\n                       \"branch\" =\u003e \"...\",\n              \"latest_revision\" =\u003e \"...\",\n            \"previous_revision\" =\u003e \"...\",\n                        \"stage\" =\u003e \"...\"\n        },\n```\n\n#### Other methods\n\n```ruby\n2.0.0 (main)\u003e db.write_point(name, data)\n2.0.0 (main)\u003e db.list_databases\n2.0.0 (main)\u003e ls -q db\nInfluxDB::Client#methods:\n  _write                    create_database       database=             delete_database_user    get_database_user_list  password   port=  queue=                username\n  alter_database_privilege  create_database_user  delete_cluster_admin  get_cluster_admin_list  host                    password=  query  update_cluster_admin  username=\n  create_cluster_admin      database              delete_database       list_databases       host=                   port       queue  update_database_user  write_point\ninstance variables: @database  @host  @http  @password  @port  @queue  @username\n```\n\n### Pry commands\n\nAs influxdb-cli is empowered with Pry, all Pry awesome commands are available in the console.\n\n#### show-source\n\n```ruby\n2.0.0 (main)\u003e show-source InfluxDB::Client#query\n\nFrom: /Users/pablo/.gem/ruby/2.0.0/gems/influxdb-0.0.11/lib/influxdb/client.rb @ line 152:\nOwner: InfluxDB::Client\nVisibility: public\nNumber of lines: 17\n\ndef query(query)\n  url = full_url(\"db/#{@database}/series\", \"q=#{query}\")\n  url = URI.encode url\n  response = @http.request(Net::HTTP::Get.new(url))\n  series = JSON.parse(response.body)\n\n  if block_given?\n    series.each { |s| yield s['name'], denormalize_series(s) }\n  else\n    series.reduce({}) do |col, s|\n      name                  = s['name']\n      denormalized_series   = denormalize_series s\n      col[name]             = denormalized_series\n      col\n    end\n  end\nend\n```\n\n#### show-doc\n\n```ruby\n\n2.0.0 (main)\u003e show-doc InfluxDB::Client#initialize\n\nFrom: /Users/pablo/.gem/ruby/2.0.0/gems/influxdb-0.0.11/lib/influxdb/client.rb @ line 13:\nOwner: InfluxDB::Client\nVisibility: private\nSignature: initialize(*args)\nNumber of lines: 20\n\nInitializes a new Influxdb client\n\n=== Examples:\n\n    Influxdb.new                               # connect to localhost using root/root\n                                               # as the credentials and doesn't connect to a db\n\n    Influxdb.new 'db'                          # connect to localhost using root/root\n                                               # as the credentials and 'db' as the db name\n\n    Influxdb.new :username =\u003e 'username'       # override username, other defaults remain unchanged\n\n    Influxdb.new 'db', :username =\u003e 'username' # override username, use 'db' as the db name\n\n=== Valid options in hash\n\n+:hostname+:: the hostname to connect to\n+:port+:: the port to connect to\n+:username+:: the username to use when executing commands\n+:password+:: the password associated with the username\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphstc%2Finfluxdb-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphstc%2Finfluxdb-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphstc%2Finfluxdb-cli/lists"}