File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,32 @@ for await (const fileInfo of hub.listFiles({repo})) {
9393await hub .deleteRepo ({ repo , accessToken: " hf_..." });
9494```
9595
96+ ## CLI usage
97+
98+ You can use ` @huggingface/hub ` in CLI mode to upload files and folders to your repo.
99+
100+ ``` console
101+ npx @huggingface/hub upload coyotte508/test-model .
102+ npx @huggingface/hub upload datasets/coyotte508/test-dataset .
103+ # Same thing
104+ npx @huggingface/hub upload --repo-type dataset coyotte508/test-dataset .
105+ # Upload new data with 0 history in a separate branch
106+ npx @huggingface/hub upload coyotte508/test-model . --revision release --empty
107+
108+ npx @huggingface/hub --help
109+ npx @huggingface/hub upload --help
110+ ```
111+
112+ You can also instal globally with ` npm install -g @huggingface/hub ` . Then you can do:
113+
114+ ``` console
115+ hfx upload coyotte508/test-model .
116+ hfx upload --repo-type dataset coyotte508/test-dataset . --revision release --empty
117+
118+ hfx --help
119+ hfx upload --help
120+ ```
121+
96122## OAuth Login
97123
98124It's possible to login using OAuth ([ "Sign in with HF"] ( https://huggingface.co/docs/hub/oauth ) ).
Original file line number Diff line number Diff line change 5858 " face"
5959 ],
6060 "bin" : {
61- "@huggingface/hub " : " ./dist/cli.js"
61+ "hfx " : " ./dist/cli.js"
6262 },
6363 "author" : " Hugging Face" ,
6464 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export async function createBranch(params: {
2323 empty ?: boolean ;
2424 /**
2525 * Use this to overwrite the branch if it already exists.
26+ *
27+ * If you only specify `overwrite` and no `revision`/`empty`, and the branch already exists, it will be a no-op.
2628 */
2729 overwrite ?: boolean ;
2830} ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments