Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit bd5c364

Browse files
committed
add apiKey usage details; minor doc fixes
1 parent aaed978 commit bd5c364

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ First, sign in to your [Paperspace account](https://paperspace.com). Click 'Laun
5656

5757
## Usage
5858

59-
You can interact with Paperspace's API in three ways: programatically (from within JavaScript), from the command line (using the Paperspace CLI), or using an HTTP client of your choice and the Paperspace API HTTP enpoints documented here. The JavaScript libabry and the CLI are backed by the same underlying API client.
59+
You can interact with Paperspace's API in three ways: programatically (from within JavaScript), from the command line (using the Paperspace CLI), or using an HTTP client of your choice and the Paperspace API HTTP enpoints documented here. The JavaScript library and the CLI are backed by the same underlying API client.
6060

6161
### Programmatic
6262

63-
We'll be illustrating all examples using [ES5](http://speakingjs.com/es5/ch01.html) syntax and the CommonJS module format. For other systems like AMD, consider using a bundler such as Browserify.
63+
We'll be illustrating all examples using [ES5](http://speakingjs.com/es5/ch01.html) syntax and the CommonJS module format. For other systems like Asynchronous Module Definition, consider using a bundler such as Browserify.
6464

6565
First install the `paperspace-node` package in your project directory using:
6666

@@ -73,7 +73,7 @@ Within your node.js app you can import the package with:
7373
Then create an instance of the client, passing in your authentication credentials:
7474

7575
var paperspace = paperspace_node({
76-
apiKey: '0b3c5f...' // <~ Copy+paste your key here
76+
apiKey: '1ba4f98e7c0...' // <- paste your api key here
7777
});
7878

7979
#### Calling the API programmatically
@@ -96,16 +96,23 @@ Assuming you've installed the `paperspace-node` package, you can invoke the Pape
9696

9797
$ paperspace --help
9898

99-
For authenticated requests, the Paperspace CLI will look in two places:
99+
For authenticated requests, the Paperspace CLI will look in two places for an api key:
100+
101+
1) A command argument: `--apiKey`. Example:
102+
103+
$ paperspace machines show --apiKey "1ba4f98e7c0..." --machineId "ps123abc"
104+
105+
2) An environment variable: `PAPERSPACE_API_KEY`. Example:
106+
107+
$ export PAPERSPACE_API_KEY=1ba4f98e7c0...
108+
$ paperspace machines show --machineId "ps123abc"
100109

101-
- CLI argument: `--apiKey`
102-
- Environment variable: `PAPERSPACE_API_KEY`
103110

104111
#### Calling the API with the CLI
105112

106-
The CLI provides all methods as subcommands. For example:
113+
The CLI provides all methods as subcommands, using this scheme: `paperspace <namespace> <subcommand>`. For example:
107114

108-
$ paperspace machines create --name "My Machine" --size 50 # etc.
115+
$ paperspace machines create --apiKey "1ba4f98e7c0..." --machineName "My Machine" --size 50 ...
109116

110117
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-node).
111118

scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The metadata available includes the user specified machine 'name', the paperspac
105105
{
106106
"id": "ps123abc",
107107
"name": "My Machine",
108-
"hostname": "pssiq341",
108+
"hostname": "ps123abc",
109109
"privateIpAddress": "10.63.0.97",
110110
"publicIpAddress": ""
111111
}

0 commit comments

Comments
 (0)