Cloud

fw structures import

structures import

Save a folder's layout as a structure on Framework Cloud

Added in 0.4.0.

Maps the folders of DIR (default: the current folder) to Framework's directories, the same way as fw adopt, and saves the layout as a structure on Framework Cloud, private to you. fw looks at folder names only, at most three levels deep, and sends only the folder paths and their roles: never file names or contents. Nothing in the folder changes.

At a terminal fw shows the proposed mapping and lets you change a folder's role before saving. Without one, pass --yes after reading it. With --json and no --yes, fw prints the proposed mapping and saves nothing.

Usage

fw structures import [DIR] [flags]

Options

Name Type Description
DIR string
--description string

a description for the structure

--json bool

print JSON on stdout, for scripts and agents

--lang string

map folders for this language: r, python, or stata (default: detected, else r)

--name string

the structure's name (default: the folder's name)

--url string

Framework Cloud server

Environment variable: FW_CLOUD_URL

-y, --yes bool

accept the proposed mapping and save it without asking

Value

With --json and no --yes, the proposed mapping and nothing saved: {"name", "language", "saved": false, "directories", "extra_directories", "warnings"}. With --yes, the same with "saved": true and the new structure's key, name, and url. Each warning is {"code": "private_path", "path": ...}.

Exit codes

Code Meaning
0 Success
1 Failure
2 Bad flags or arguments
3 Not logged in, or the server rejected the token
4 The server has no such project or resource
5 Browser login was denied, or its code expired
6 An upload has "private" in a path; rerun with --include-private if you mean to send it

With --json, a failure also prints one JSON line on stderr: {"error": "...", "exit_code": 4}. Exit code 6 adds "reason": "private_path".

Examples

fw structures import ~/projects/old-study --name "Lab layout"
fw structures import --json
fw structures import --yes --json

Related reference