code: func ExportPrivateKey(ctx context.Context, c *cli.Context) error {
  	if err := initCrypto(); err != nil {
  		return action.ExitError(ctx, action.ExitUnknown, err, "failed to init XC")
  	}
  
  	id := c.String("id")
  	file := c.String("file")
  
  	if id == "" {
  		return action.ExitError(ctx, action.ExitUsage, nil, "need id")
  	}
  	if file == "" {
  		return action.ExitError(ctx, action.ExitUsage, nil, "need file")
  	}
  
  	if fsutil.IsFile(file) {
  		return action.ExitError(ctx, action.ExitUnknown, nil, "output file already exists")
  	}
  
  	pk, err := crypto.ExportPrivateKey(ctx, id)
  	if err != nil {
  		return action.ExitError(ctx, action.ExitUnknown, err, "failed to export key: %s", err)
  	}
  
  	if err := ioutil.WriteFile(file, pk, 0600); err != nil {
  		return action.ExitError(ctx, action.ExitIO, err, "failed to write file")
  	}
  	return nil
  }
docs: // ExportPrivateKey exports an XC key