Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cosmicjs/cosmic-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 49cb0db29636add1d5a6424d465af1881893b972
Choose a base ref
..
head repository: cosmicjs/cosmic-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02970b937ab86a530bea8a27a2f135a81dd1041f
Choose a head ref
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<p align="center">
<a href="https://cosmicjs.com"><img src="https://cosmic-s3.imgix.net/e18557d0-f3fc-11e7-b948-afa0abf2fc70-cosmicjs-logo.png?w=900" alt="Cosmic JS" width="400"></a>
<a href="https://www.cosmicjs.com"><img src="https://cdn.cosmicjs.com/3cf62ab0-8e13-11ea-9b8f-cd0254a8c979-cosmic-dark.svg" alt="Cosmic" width="400"></a>
</p>
<p align="center">
📖 <a href="https://docs.cosmicjs.com">View Docs</a>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/cosmic-cli"><img src="https://badge.fury.io/js/cosmic-cli.svg" alt="npm version"></a>
</p>

[![npm version](https://badge.fury.io/js/cosmic-cli.svg)](https://www.npmjs.com/package/cosmic-cli)

This is the official command line tool for [Cosmic JS](https://cosmicjs.com). Use it to log in to your Cosmic JS account, manage Buckets, data, files and users within your Buckets, all from the comfort of your command line interface.
This is the official command line tool for [Cosmic](https://www.cosmicjs.com). Use it to log in to your Cosmic account, manage Buckets, data, files and users within your Buckets, all from the comfort of your command line interface.

## 🛠️ Installation

@@ -26,7 +30,7 @@ cosmic begin

### 🔐 Login

Use your credentials (from https://cosmicjs.com) to login on the command line. You will only have to do this once. If you used GitHub to sign up, you can also login via authentication token which you can find at https://cosmicjs.com/account/authentication
Use your credentials (from https://www.cosmicjs.com) to login on the command line. You will only have to do this once. If you used GitHub to sign up, you can also login via authentication token which you can find at https://www.cosmicjs.com/account/authentication

```bash
$ cosmic login
@@ -56,7 +60,7 @@ Now using bucket simple-react-blog
To test that we connected to the Bucket properly:

```bash
$ cosmic get-objects --limit 1
$ cosmic get-objects --query '{"type":"authors"}' --limit 1
Success
{ objects:
[ { _id: '59df6dd5fd8d731b2100118d',
@@ -65,7 +69,7 @@ Success
title: 'Jane Doe',
content: '<p>Something about Jane...</p>',
metafields: [Array],
type_slug: 'authors',
type: 'authors',
created: '2017-10-12T13:27:49.663Z',
created_at: '2017-10-12T13:27:49.663Z',
status: 'published',
@@ -88,7 +92,7 @@ Below are a few examples of commands. Only a handful of the possible options are
**Creating an Object Type and then an Object**
Creating a "Planets" Object Type and specifying default Metafields all Objects in this Object Type should have. For this example all planets will now include the Metafield titled "Radius". See the [REST API docs](https://cosmicjs.github.io/rest-api-docs/?javascript#metafields) for all Metafield options.
Creating a "Planets" Object Type and specifying default Metafields all Objects in this Object Type should have. For this example all planets will now include the Metafield titled "Radius". See the [REST API docs](https://docs.cosmicjs.com/rest-api/metafields.html) for all Metafield options.
```bash
$ cosmic add-object-type --slug planets --title Planets --metafields '[{"title": "Radius","type":"text", "key": "radius"}]'
```
@@ -100,7 +104,7 @@ $ cosmic edit-object-type -s planets --metafields '[{"title": "Radius","type":"t
Creating an Object in the "Planets" Object Type:
```bash
$ cosmic add-object --type_slug planets --title Venus --metafields '[{"title": "Radius","type":"text", "key": "radius", "value": "3,760 miles"},{"title": "Distance from Sun","type":"text", "key": "distance_from_sun", "value": "67.24 million miles"}]'
$ cosmic add-object --type planets --title Venus --metafields '[{"title": "Radius","type":"text", "key": "radius", "value": "3,760 miles"},{"title": "Distance from Sun","type":"text", "key": "distance_from_sun", "value": "67.24 million miles"}]'
```
🏞 **Uploading Files to a Bucket**
@@ -119,13 +123,13 @@ Some commands allow for two types of input: argument based and json string based
To add a new barebones Object with only a title that is of Object Type `planets`, there are two ways we could go about it, with equivalent results:
```bash
$ cosmic add-object --type_slug planets --title Venus
$ cosmic add-object --type planets --title Venus
```
or
```bash
$ cosmic add-object --json '{"type_slug": "planets", "title": "Venus"}'
$ cosmic add-object --json '{"type":"planets","title":"Venus"}'
```
The json string option is convenient in some use cases, and is included on the following commands:
@@ -142,17 +146,11 @@ For a list of the options for a command, use `cosmic [command] -h`
* begin `Guide to Getting Started`
* login
* init `init starter app` See [list of starter apps](https://www.cosmicjs.com/getting-started#getting-started-quickstart)
* which-user `outputs the email of the current user`
* which-bucket `outputs the slug of the current Bucket`
* which-app `outputs the slug of the current app`
* get-buckets [options] `shows Buckets available to user`
* install-app `installs an app to your bucket and downloads the repo to your machine`
* deploy-app [options] `deploys an app to the Cosmic App Server`
* view-app `Opens browser window with demo link`
* browse-apps [options] `search for apps or see all`
* start-app `starts a downloaded app on your machine`
* get-bucket [options] `get current bucket object`
* use-bucket [options] [slug]
* use-bucket [options] [slug] `read_key and write_key options required`
* add-bucket [options]
* delete-bucket [options]
* get-objects [options]
@@ -167,6 +165,4 @@ For a list of the options for a command, use `cosmic [command] -h`
* add-media [options]
* get-media [options]
* delete-media [options]
* add-webhook [options]
* delete-webhook [options]
* add-user [options]
Loading