Answers.Body: <p>The graphical api explorer actually fetches all its information <em>about</em> the api <em>from</em> the api. Since the CiviCRM api is available from the command line, you can explore it using the same methods.</p>
  
  <ul>
  <li><p>Fetch the list of entities:</p>
  
  <p>$ cv api Entity.get</p></li>
  <li><p>List available actions for an entity:</p>
  
  <p>$ cv api Activity.getactions</p></li>
  <li><p>Get fields for an entity/action:</p>
  
  <p>$ cv api Activity.getfields action=create</p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-01T04:36:07.123Z
Answers.Text: Is this the extent of information available from commandline?  I'd love to be able see the available entities, actions, and keys and what they can take for values.
Answers.UserDisplayName: alec
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-01T12:13:54.070Z
Answers.Text: Updated my answer
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-01T16:10:17.840Z
Answers.Text: Oh that's great, thanks!  That'd be super helpful for first orienting to using `cv` if that was printed in the output of `cv api --help`.  I think I'm going have a lot of questions around this and I'm not sure how much I should post those here.  It looks like there's not much "Getting started with CiviCRM's CLI" tutorial around, I'd be glad to contribute towards one.
Answers.UserDisplayName: alec
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-01T16:37:57.020Z
Answers.Text: I guess I should explore before asking any more questions, as I'm answering them myself.  `cv api Setting.get | peco` is a helpful way to explore all that json output.  Thanks again!
Answers.UserDisplayName: alec
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-29T01:42:57.017Z
Answers.LastActivityDate: 2018-09-01T12:13:43.583Z
Answers.LastEditDate: 2018-09-01T12:13:43.583Z
Answers.UserDisplayName: Coleman
Body: <p>Is there a way to explore the API from the command line instead of going to mycivicrmsite.localhost/civicrm/api in a web browser?</p>
  
  <p>I wasn't able to learn much from the <code>cv</code> help.  For example, you can <code>cv api contact.get...</code> but what else can you <code>cv api contact.do?</code></p>
  
  <p>I know I can just go over to the web browser and pull up that page, but I just wanna hang out in my terminal :)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-29T11:20:53.740Z
Comments.Text: Just curious - why?  The API Explorer guides you in constructing an API call and shows you the syntax in the various supported languages and commands. It also has examples and code docs built in.
Comments.UserDisplayName: Aidan
Tags: <api><cli>
Title: How to explore API from command line?
ThreadText: # How to explore API from command line?
  
  (Asked by: username_0 on 2018-08-28)
  
  Is there a way to explore the API from the command line instead of going to mycivicrmsite.localhost/civicrm/api in a web browser?
  
  I wasn't able to learn much from the `cv` help. For example, you can `cv api contact.get...` but what else can you `cv api contact.do?`
  
  I know I can just go over to the web browser and pull up that page, but I just wanna hang out in my terminal :)
  
  **Tags:** api, cli
  
  > **Comments:**
  > **username_1**: Just curious - why?  The API Explorer guides you in constructing an API call and shows you the syntax in the various supported languages and commands. It also has examples and code docs built in.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-08-29. Score: 2 | Accepted answer
  
  The graphical api explorer actually fetches all its information *about* the api *from* the api. Since the CiviCRM api is available from the command line, you can explore it using the same methods.
  
  * Fetch the list of entities:
  
    $ cv api Entity.get
  * List available actions for an entity:
  
    $ cv api Activity.getactions
  * Get fields for an entity/action:
  
    $ cv api Activity.getfields action=create
  
  > **Comments:**
  > **username_0**: Is this the extent of information available from commandline?  I'd love to be able see the available entities, actions, and keys and what they can take for values.  
  > **username_2**: Updated my answer  
  > **username_0**: Oh that's great, thanks!  That'd be super helpful for first orienting to using `cv` if that was printed in the output of `cv api --help`.  I think I'm going have a lot of questions around this and I'm not sure how much I should post those here.  It looks like there's not much "Getting started with CiviCRM's CLI" tutorial around, I'd be glad to contribute towards one.  
  > **username_0**: I guess I should explore before asking any more questions, as I'm answering them myself.  `cv api Setting.get | peco` is a helpful way to explore all that json output.  Thanks again!  
  
  ---
  
  