Code Monkey home page Code Monkey logo

cosmic-cli's People

Contributors

robinjayaswal avatar tonyspiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cosmic-cli's Issues

json inputs

need to add option for json inputs to all commands

Command List

CLI

npm i cosmic-cli -g
cosmic login (save creds)
cosmic create-user
cosmic add-bucket -slug "bucket-slug" -title "New Test Bucket"
cosmic use-bucket -slug bucket-slug -read_key -write_key (connect to bucket, save)
cosmic add-user -first_name -last_name -email
cosmic install-app app-slug
cosmic add-object-type
cosmic get-object-types
cosmic delete-object-type
cosmic add-object
cosmic get-objects
cosmic get-object
cosmic edit-object
cosmic delete-object
cosmic add-media
cosmic get-media
cosmic delete-media

-d as JSON
-file as JSON file path

Example:

npm i cosmic-cli -g
cosmic

Options
create-user
login

Options
Add-bucket
Bucket

Options
Object-type, object, media, extensions, webhooks

Can't use use-bucket command

Login command works and returns authenticated. But use-bucket returns Not authorized.

Do I have to use the read key or is this a problem with Windows? Token & email is stored in C:\Users\Alexander\.config\configstore\cosmic-cli.json

Is there a way to get a debug print to get more details why it returns 'Not authorized'?

I'm running Windows 10 Pro (64bit).

Here is a screenshot from my console output from cmd.exe with-in VS code:
grafik

Tested the cli also in a virtual machine with Ubuntu 16.0.4.3 (64bit) with the same log message - so this is not an issue that's only related to Windows.

Install App Commands

install-app // 1. Are you sure 2. PUT /buckets/:id
start-app // 1. cd in 2. npm start connected to Bucket
// deploy-app

add_media filename endings. if we take user title, how to ensure it ends in correct filetype

couple subquestions:

  • Should we just take the filename that the user has locally
  • If we allow them to specify their own, should we attach the extension to the filename if they do not. For png's for example, if they say 'myimage' for the filename, the upload does not recognize it is a png. So we should take the ending from the filename itself probably and convert 'myimage' to 'myimage.png'. make sure to check they did not already include '.png' at end

New Commands

cosmic get-buckets // shows available Bucket slugs available to user, needs new endpoint GET /v1/buckets
cosmic get-objects-types -h // remove all flags, they don't do anything for Object Types
cosmic get-objects --type_slug // will use getObjectsByType
cosmic delete-bucket // deletes Bucket
cosmic command-does-not-exist // needs error message, currently returns nothing

Metafields

Just as we discussed, adding a flag like this:

--metafields '[{type:"text", key: "headline", value: "This is AWESOME"}]'

This will need to be on the following commands:

  • Add Object
  • Edit Object
  • Add Object Type
  • Edit Object Type

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.