github.com/anthonymayer/glide@v0.0.0-20160224162501-bff8b50d232e/docs/commands.md (about) 1 # Commands 2 3 The following are the Glide commands, most of which are to help yoy manage your workspace. 4 5 ## glide create (aliased to init) 6 7 Initializes a new workspace. Among other things, this creates a `glide.yaml` file while attempting to guess the packages and versions to put in it. For example, if your project is using Godep it will use the versions specified there. Glide is smart enough to scan your codebase and detect the imports being used whether they are specified with another package manager or not. 8 9 $ glide init 10 [INFO] Generating a YAML configuration file and guessing the dependencies 11 [INFO] Attempting to import from other package managers (use --skip-import to skip) 12 [INFO] Found reference to github.com/BurntSushi/toml 13 [INFO] Found reference to github.com/Masterminds/semver 14 [INFO] Found reference to github.com/Masterminds/sprig 15 [INFO] Found reference to github.com/Masterminds/vcs 16 [INFO] Found reference to github.com/aokoli/goutils 17 [INFO] Found reference to github.com/codegangsta/cli 18 [INFO] Found reference to github.com/deis/pkg/prettyprint 19 [INFO] Found reference to github.com/ghodss/yaml 20 [INFO] Found reference to github.com/google/go-github/github 21 [INFO] Found reference to github.com/pborman/uuid 22 [INFO] Found reference to golang.org/x/crypto/nacl/box 23 [INFO] Adding sub-package ssh/terminal to golang.org/x/crypto 24 [INFO] Found reference to gopkg.in/yaml.v2 25 ... 26 27 ## glide get [package name] 28 29 You can download one or more packages to your `vendor` directory and have it added to your 30 `glide.yaml` file with `glide get`. 31 32 $ glide get github.com/Masterminds/cookoo 33 34 When `glide get` is used it will introspect the listed package to resolve its dependencies including using Godep, GPM, and GB config files. 35 36 The `glide get` command can have a [version or range](versions.md) passed in with the package name. For example, 37 38 $ glide get github.com/Masterminds/cookoo#^1.2.3 39 40 The version is separated from the package name by an anchor (`#`). 41 42 ## glide update (aliased to up) 43 44 Download or update all of the libraries listed in the `glide.yaml` file and put them in the `vendor` directory. It will also recursively walk through the dependency packages doing the same thing if no `vendor` directory exists. 45 46 $ glide up 47 48 This will recurse over the packages looking for other projects managed by Glide, Godep, gb, and GPM. When one is found those packages will be installed as needed. 49 50 A `glide.lock` file will be created or updated with the dependencies pinned to specific versions. For example, if in the `glide.yaml` file a version was specified as a range (e.g., `^1.2.3`) it will be set to a specific commit id in the `glide.lock` file. That allows for reproducible installs (see `glide install`). 51 52 ## glide install 53 54 When you want to install the specific versions from the `glide.lock` file use `glide install`. 55 56 $ glide install 57 58 This will read the `glide.lock` file, warning you if it's not tied to the `glide.yaml` file, and install the commit id specific versions there. 59 60 When the `glide.lock` file doesn't tie to the `glide.yaml` file, such as there being a change, it will provide an warning. Running `glide up` will recreate the `glide.lock` file when updating the dependency tree. 61 62 If no `glide.lock` file is present `glide install` will perform an `update` and generates a lock file. 63 64 ## glide novendor (aliased to nv) 65 66 When you run commands like `go test ./...` it will iterate over all the subdirectories including the `vendor` directory. When you are testing your application you may want to test your application files without running all the tests of your dependencies and their dependencies. This is where the `novendor` command comes in. It lists all of the directories except `vendor`. 67 68 $ go test $(glide novendor) 69 70 This will run `go test` over all directories of your project except the `vendor` directory. 71 72 ## glide name 73 74 When you're scripting with Glide there are occasions where you need to know the name of the package you're working on. `glide name` returns the name of the package listed in the `glide.yaml` file. 75 76 ## glide list 77 78 Glide's `list` command shows an alphabetized list of all the packages that a project imports. 79 80 ``` 81 $ glide list 82 INSTALLED packages: 83 vendor/github.com/Masterminds/cookoo 84 vendor/github.com/Masterminds/cookoo/fmt 85 vendor/github.com/Masterminds/cookoo/io 86 vendor/github.com/Masterminds/cookoo/web 87 vendor/github.com/Masterminds/semver 88 vendor/github.com/Masterminds/vcs 89 vendor/github.com/codegangsta/cli 90 vendor/gopkg.in/yaml.v2 91 ``` 92 93 ## glide help 94 95 Print the glide help. 96 97 ``` 98 $ glide help 99 ``` 100 101 ## glide --version 102 103 Print the version and exit. 104 105 ``` 106 $ glide --version 107 glide version 0.9.0 108 ```