osrc-cli v0.0.5-beta
OSRC CLI
The cli tool for users deploy website(static site) to OSRC PAGES.
Quickly Start
- Install Cli via
npm
oryarn
npm i -g osrc-cli
# or
yarn global add osrc-cli
then you can get the cli osrc
, just use it like:
osrc
Usage: osrc [command]
osrc frontend tools
Options:
-V, --version output the version number
-r,--remote <remote> config osrc deploy target, this is for developer of osrc,defalut is https://www.osrc.com,
-h, --help display help for command
Commands:
info print config info
login login osrc
deploy deploy built assets to osrc, default target is dist
- tips :
osrc-cli support "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - workaround for other node version: build the SPA project with your wanted node version, the switch to others node version for use osrc cli!
Build Project Static Files
Osrc Login
osrc login
# input username and password, got the token and store
- Osrc Deploy
The deployment default static file dir is dist
, if your project's static build output as dist
, you can ignore the dist
para!
# after 2.Build Project Static Files
# custom the deploy dir or use default `dist`
osrc deploy
osrc deploy -d dist
osrc deploy --dirname dist
- Success!
You can visit the osrc.com workbench to see the project you just deployed now!
How to Use
Config Info
# print the osrc config info of current
osrc info
login
osrc login
# input username and password, got the token and store
deploy
The deployment default static dir is dist
, if your project's static build output as dist
, you can ignore this para!
# after the build finished
# custom the deploy dir or use default `dist`
osrc deploy
osrc deploy -d dist
osrc deploy --dirname dist
The login to osrc config file store as
location: ~/.osrc
the config info store as:
{
"remote": "https://www.osrc.com",
"username": "osrc",
"accessToken": "3Uf3Lcdx45KmaZASPV_xxxxxxxxx",
"tokenType": "Bearer",
"scope": {
"type": "user",
"id": "xxxx"
}
}
custom osrc server address
this is for developer, the default is https://www.osrc.com/, you can ignore this cmd!
osrc -r https://www.osrc.com/
osrc --remote https://www.osrc.com/
Dev Advanced
usr 'nodejs esmodule' for the osrc command tools
For Debug
DEBUG=* nodejs scripts/osr-cli/osrc-cli.mjs login
For dev use 'npm link' get the osrc cmd
yarn
npm link
osrc
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago