Giter Club home page Giter Club logo

apiary-client's Introduction

Apiary CLI Client

Apiary CLI client, apiary.

Build Status Build status

Description

The Apiary CLI Client gem is a command line tool for developing and previewing API Blueprint documents locally. It can also be used for pushing updated documents to and fetching existing documents from Apiary.

Please see the apiary help command and the full documentation for an in-depth look in how to use this tool.

For instructions on making your own changes, see Hacking Apiary CLI Client, below.

Installation

Install as a Ruby gem

gem install apiaryio

Using Docker - alternative if you don't install ruby or installation not work for you

Download image:

docker pull apiaryio/client

Run instead apiary just docker run apiaryio/client

Build from source code:

docker build -t "apiaryio/client" .

Setup Apiary credentials

Required only for publish and fetch commands.

  1. Make sure you are a registered user of Apiary.
  2. Retrieve API key (token) on this page.
  3. Export it as an environment variable:
export APIARY_API_KEY=<your_token>

Command-line Usage

$ apiary help
Commands:
  apiary fetch --api-name=API_NAME    # Fetch API Description Document from API_NAME.apiary.io
  apiary help [COMMAND]               # Describe available commands or one specific command
  apiary preview                      # Show API documentation in browser or write it to file
  apiary publish --api-name=API_NAME  # Publish API Description Document on docs.API_NAME.apiary.io (API Description must exist on apiary.io)
  apiary styleguide                   # Check API Description Document against styleguide rules (Apiary.io pro plan is required - https://apiary.io/plans )
  apiary version                      # Show version

Details

fetch

$ apiary help fetch
Usage:
  apiary fetch --api-name=API_NAME

Options:
  --api-name=API_NAME  
  [--api-host=HOST]    # Specify apiary host
  [--output=FILE]      # Write API Description Document into specified file

Fetch API Description Document from API_NAME.apiary.io

preview

$ apiary help preview
Usage:
  apiary preview

Options:
  [--browser=BROWSER]        # Show API documentation in specified browser (full command is needed - e.g. `--browser='open -a safari'` in case of osx)
  [--output=FILE]            # Write generated HTML into specified file
  [--path=PATH]              # Specify path to API Description Document. When given a directory, it will look for `apiary.apib` and `swagger.yaml` file
  [--json], [--no-json]      # Specify that Swagger API Description Document is in json format. Document will be converted to yaml before processing
  [--api-host=HOST]          # Specify apiary host
  [--server], [--no-server]  # Start standalone web server on port 8080
  [--port=PORT]              # Set port for --server option
  [--host=HOST]              # Set host for --server option
  [--watch], [--no-watch]    # Reload API documentation when API Description Document has changed

Show API documentation in browser or write it to file

publish

$ apiary help publish
Usage:
  apiary publish --api-name=API_NAME

Options:
  [--message=COMMIT_MESSAGE]  # Publish with custom commit message
  [--path=PATH]               # Specify path to API Description Document. When given a directory, it will look for `apiary.apib` and `swagger.yaml` file
  [--json], [--no-json]       # Specify that Swagger API Description Document is in json format. Document will be converted to yaml before processing
  [--api-host=HOST]           # Specify apiary host
  [--push], [--no-push]       # Push API Description to the GitHub when API Project is associated with GitHub repository in Apiary
                              # Default: true
  --api-name=API_NAME         

Publish API Description Document on docs.API_NAME.apiary.io (API Description must exist on apiary.io)

styleguide

$ apiary help styleguide
Usage:
  apiary styleguide

Options:
  [--fetch], [--no-fetch]              # Fetch styleguide rules and functions from apiary.io
  [--add=ADD]                          # Path to API Description Document. When given a directory, it will look for `apiary.apib` and `swagger.yaml` file
  [--functions=FUNCTIONS]              # Path to to the file with functions definitions
  [--rules=RULES]                      # Path to to the file with rules definitions - `functions.js` and `rules.json` are loaded if not specified
  [--full-report], [--no-full-report]  # Get passed assertions ass well. Only failed assertions are included to the result by default
  [--json], [--no-json]                # Outputs all in json

Check API Description Document against styleguide rules (Apiary.io pro plan is required - https://apiary.io/plans )

version

$ apiary help version
Usage:
  apiary version

Options:
  [--{:aliases=>"-v"}={:ALIASES=>"-V"}]  

Show version

Hacking Apiary CLI Client

Build

  1. If needed, install bundler:

    $ gem install bundler
  2. Clone the repo:

    $ git clone [email protected]:apiaryio/apiary-client.git
    $ cd apiary-client
  3. Install dependencies:

    $ bundle install

Test

Inside the apiary-client repository directory run:

$ bundle exec rspec spec
$ bundle exec cucumber

Release

Use bundle install to install your changes locally, for manual and ad-hock testing.

Only gem owners gem owner apiaryio can publish new gem into RubyGems.

$ rake release

License

Copyright 2012-17 (c) Apiary Ltd.

Released under MIT license. See LICENSE file for further details.

apiary-client's People

Contributors

almad avatar abtris avatar honzajavorek avatar eparreno avatar freaz avatar smizell avatar matthewrudy avatar pimpin avatar kylef avatar tinexw avatar mojowill avatar jackub avatar iomoss-automata avatar balupton avatar edenvicary avatar jrep avatar kuba-kubula avatar fosrias avatar peterstrapp-msm avatar zdne avatar bootstraponline avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.