Skip to content

Commit

Permalink
Merge branch 'release/v1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecaruso committed Oct 24, 2020
2 parents 48a965b + 8e503be commit ab1cce5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# **K**ey**C**hain**C**lipboard
> CLI command which stores your credentials and load passwords in clipboard when you need them
```
Store your services' credentials and load passwords in clipboard when you need them:
Expand All @@ -14,7 +15,7 @@ Available Commands:
del delete service credentials
get get password
help Help about any command
version Show current version
version show current version
Flags:
--config string config file (default is $HOME/.kcc.yaml)
Expand All @@ -24,6 +25,19 @@ Flags:
Use "kcc [command] --help" for more information about a command.
```

## How it works
Credentials are saved in a file with `root` permissions so you must enter your system password.
Passwords are copied in clipboard when you need them.

## Custom storage file
Default storage file is located in `$HOME/.kcc.storage`, but if you want to customize it you have to follow these steps:
- create a config file – default is `$HOME/.kcc.yaml`
- set the *storage* key in the yaml file with an absolute path to the storage file as value. Example:
```yaml
storage: /absolute/path/to/storage/file
```
- if config file location is not equal to the default, run `kcc` with the ` --config /path/to/config.yaml ` flag

## Author
[Davide Caruso](https://about.me/davidecaruso)

Expand Down
11 changes: 2 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import (
)

var (
cwd, _ = os.Getwd()
config string
home, _ = homedir.Dir()
Verbose bool
Storage = storage.Storage{Path: cwd + "/assets/.storage"}
Storage = storage.Storage{Path: home + "/.kcc.storage"}
)

// rootCmd represents the base command when called without any subcommands
Expand Down Expand Up @@ -69,13 +69,6 @@ func initConfig() {
// Use config file from the flag.
viper.SetConfigFile(config)
} else {
// Find home directory.
home, err := homedir.Dir()
if err != nil {
fmt.Println(err)
os.Exit(1)
}

// Search config in home directory with name ".kcc" (without extension).
viper.AddConfigPath(home)
viper.SetConfigName(".kcc")
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show current version",
Short: "show current version",
Long: "",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("v1.1.0")
Expand Down

0 comments on commit ab1cce5

Please sign in to comment.